I'm in IPython and want to run a simple python script that I've saved in a file called "test.py". 
I'd like to use the %run test.py command to execute it inside IPython, but I don't know to which folder I need to save my test.py. 
Also, how can I change that default folder to something else, for example C:\Users\user\foldername ? 
I tried with the .ipython folder (original installation folder) but that's not working.
%run myprogram works for Python scripts/programs.
To run any arbitrary programs, use ! as a prefix, e.g. !myprogram.
Many common shell commands/programs (cd, ls, less, ...) are also registered as IPython magic commands (run via %cd, %ls, ...), and also have registered aliases, so you can directly run them without any prefix, just as cd, ls, less, ...
IPython - running a script with %run command - saved to which folder?