How can I compile and run a python file (*.py extension)?
To add to Paul McMillan's answer, if you are on Windows and you have Python installed, then any files ending with the extension ".py" should be associated with the python
executable, allowing you to run it like so:
> myfile.py
In *nix, you can begin the file with #!/usr/bin/python
and run it like so:
$ ./myfile.py
In *nix systems, if the first two characters of a file are #!
then it will execute the file with the specified executable, which I set here to be /usr/bin/python
.