Running python script inside ipython


Question

Is it possible to run a python script (not module) from inside ipython without indicating its path? I tried to set PYTHONPATH but it seems to work only for modules. I would like to execute

%run my_script.py

without being in the directory containing the file.

1
110
5/3/2014 12:04:19 AM

from within the directory of "my_script.py" you can simply do:

%run ./my_script.py
99
3/12/2015 4:44:31 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon