How can I start ipython running a script?

Viewed 42637

My use case is I want to initialize some functions in a file and then start up ipython with those functions defined. Is there any way to do something like this?

ipython --run_script=myscript.py
7 Answers

In recent versions of ipython you do need to add the -i option to get into the interactive environment afterwards. Without the -i it just runs the code in myfile.py and returns to the prompt.

$ ipython -i myfile.py
Related