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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -