How to Compile & Execute in Python
Python is a high-level programming language that is compatible with Linux, Windows and Mac operating systems. Compiling scripts can take several steps depending on the programming language used. With Python, compiling takes one step: It automatically compiles your script when it is executed into byte code, saving time. Executing your script is a matter of entering your file name into the Windows command prompt.
Instructions
-
-
1
Click "Start," "All Programs" and "Notepad" to open the text editor. Click "File" and "New" to open a new file.
-
2
Type and compile the Python script you want to execute. Save your file when you are done by clicking "File" and "Save As." Save the file with the ".Py" extension. Name your file and click "Save."
-
-
3
Click "Start" and type "Cmd." Press "Enter" to open the command prompt window. Type "scriptname.py" and press "Enter." Replace "scriptname" with the name of your Python script. This executes your Python file.
-
1
References
- "Learning Python"; Mark Lutz; 2008