python - IPython - running a script with %run command - saved to which folder? -


i'm in ipython , want run simple python script i've saved in file called "test.py".

i'd use %run test.py command execute inside ipython, don't know folder need save test.py.

also, how can change default folder else, example c:\users\user\foldername ?

i tried .ipython folder (original installation folder) that's not working.

i found answer:

import os filepath = 'c:\\users\\user\\foldername' os.chdir(filepath) %run test.py 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -