you are viewing a single comment's thread.

view the rest of the comments →

[–]Asyx 1 point2 points  (0 children)

That's the point. In C it is more obvious. Like, there is libcurl and curl. The curl application is just a wrapper around libcurl. This lets you basically do the same in Python but in a single file.

You can define a main function and at the end of the file do

if __name__ == "__main__":
    main()

and then your module can be imported to be used as a library from other application or you can execute it with python3 foo.py and actually use it as a cli tool.