How to run a python fileΒΆ
A file with python code in it is a ‘module’ or ‘script’
(more on the distinction later on...)
It should be named with the .py
extension: some_name.py
To run it, you have a couple options:
- call python on the command line, and pass in your module name
$ python the_name_of_the_script.py
- run
iPython
, and run it from within iPython with therun
command
In [1]: run the_file.py