EXECUTION FROM A FILE
Most Python scripts will be executed from a file. Python scripts are written just like Perl with a standard editor – we don't need a special environment or application to create the files. Line termination is significant, since Python relies on the line termination to identify the end of a statement, but Python is flexible enough to support Windows, MacOS, or Unix line endings under the corresponding platforms. However, if you want to exchange the script between platforms you must convert the line endings – you cannot use a Windows text script under MacOS for example.
Unlike Perl, Python doesn't distinguish quite so clearly between a “script” and a “module.” All Python source can potentially be used as a module and imported ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access