'At start of ipython load cython script

I can run script like this:

 ipython script.py

but once the script finish it exists the ipython shell. I want to stay in the shell and preserve the script.py context.

Second how can I do the same thing with Cython script. the complication here is that it has to run beforehand pyximport.install()

I'm asking because after every change i have to;

 1. exit ipython
 2. start ipython
 3. do pyximport
 4. setup my env.. very time consuming
 5. do tests
 6. change .pyx
 7. rinse and repeat

pyx reload does not work and i have to exit the shell everytime because pyximport does not recompile the second time.

putting all setup in a script.py will shorten the process



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source