You are on page 1of 1

Creating and Running Python Scripts

When starting a new project, create a directory and change into it:
mkdir directoryname
cd directoryname

Running a Python file:


- all Python files should have a .py suffix
python filename.py

Or, add to the top of each Python file:


#!usr/bin/env python

Then file can be run as:


>> ./ filename.py

If permissions are not correct:


chmod +x filename.py

You might also like