You often want to execute the contents of a file. Depending on the location of the file on your computer, it is necessary to navigate to the correct location before executing the contents of a file:
- Use the command cd in IPython in order to move to the directory where your file is located.
- To execute the contents of a file named myfile.py, just run the following command in the IPython shell:
run myfile