johannix johannix - 2 years ago 127
Python Question

Start ipython running a script

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 ipython

Answer Source

Per the docs, it's trivial:

You start IPython with the command:

$ ipython [options] files

If invoked with no options, it executes all the files listed in sequence and drops you into the interpreter while still acknowledging any options you may have set in your ipythonrc file. This behavior is different from standard Python, which when called as python -i will only execute one file and ignore your configuration setup.

So, just use ipython and there you are!-)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download