I’m trying to run a file inside the ipython interpreter.
The documentation makes this sound as simple as ipython file.py in the shell or %run file.py inside the interpreter itself. However, I want to read a file that contains commands to the ipython “system shell”. Here’s an example:
files= !ls
print files
for this type of commands, invoking the interpreter as mentioned above results in SyntaxError, as if it was executed by /usr/bin/python.
Is it possible to run a file from the system shell as if it were executing inside the ipython shell interpreter?
It looks like you can do this if you name your file with an .ipy extension.