How to Compile Python on a UNIX Terminal

In most programming languages you need to compile a script before you can run it as a program. Compiling turns your code into an executable file. Python is a self-compiling language. When you run a Python script on a computer with Python installed, the script automatically compiles and runs. So to compile Python on a UNIX terminal all you need to do is run the script.

Instructions

    • 1

      Type "cd /" followed by the path to the directory where the Python program is located. Press "Enter."

    • 2

      Type "python example.py" replacing "example" with the actual file name.

    • 3

      Press "Enter."

Related Searches:

References

Resources

Comments

Related Ads

Featured