How to Run Python Programs
So far, we’ve mostly talked about Python as a programming language. But it’s also a software package called an interpreter . An interpreter is a kind of program that executes other programs. When you write Python programs, the Python interpreter reads your program, and carries out the instructions it contains.[5] In this section we explore ways to tell the Python interpreter which programs to run.
When the Python package is installed on your machine, it generates a number of components. Depending on how you use it, the Python interpreter may take the form of an executable program, or a set of libraries linked into another program. In general, there are at least five ways to run programs through the Python interpreter:
Interactively
As Python module files
As Unix-style script files
Embedded in another system
Platform-specific launching methods
Let’s look at each of these strategies in turn.
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