Note: Cross-posting on IPy devel and Matplotlib-users list.<br><br>Hello,<br><br>My 8 hours sleep have helped me solve the riddle of IPython pylab entry from a regular Python script. Although it is funky and experimental, it works just as I have been seeking it to work for months :)<br>
<br>Here take a look at this piece of code:<br><br>(Again, the following lines must be modified in /IPython/Shell.py to start with pylab each time a request is made for IPython instantiation. To me a line can be added into ipy_user_config such as always_pylab =True )<br>
<br>     #user_opts = set([s.replace('-','') for s in argv[:3]])<div class="gmail_quote"><div>     user_opts = set(['pylab'])<font color="#888888"><br>
</font></div></div><br><br>#!/usr/bin/env python<br><br>#import matplotlib.pyplot as plt<br>#import numpy as np<br>import IPython<br><br>ipy = IPython.Shell.start(user_ns=locals())<br><br>a = arange(10)           ###<-- I am in IPython -pylab at this point no need for np.arange <br>
plot(a)                        ###<-- or plt.plot(a)<br><br>ipy.mainloop()<br><br>Later, when I drop into the IPy shell I can go ahead and manipulate my figure appropriately. Now whos() works also :)<br><br><br>Gökhan<br>