[vtkusers] running python from the interpreter

Prabhu Ramachandran prabhu_r at users.sf.net
Wed Mar 2 02:02:38 EST 2005


>>>>> "ES" == Eduardo Suarez <eduardo at ctm.ulpgc.es> writes:

    ES> Thanks a lot for your comment. My main problem is that i'm
    ES> also using itk and it takes a lot to load the itk module every
    ES> time i need to restart again.

If you need to do things from the interpreter, you should really pick
a good interactive interpreter to work with.  I prefer using IPython
(http://ipython.scipy.org).  Recent versions allow one to run wxPython
and PyGTK apps interactively using the -wthread and -gthread options.
On a vanilla Python shell or on an IPython shell you can always run a
Tkinter app interactively, the only problem being that tk.mainloop
will block.  To get around this, you can either write some code (in
your .python for example) to hijack Tkinter's mainloop to do nothing
or make sure you don't call mainloop.  Alternatively, try using
MayaVi's ivtk module to view actors interactively on a vanilla Python
shell or IPython: http://mayavi.sourceforge.net/docs/guide/x975.html#IVTK

If you choose to use Pycrust, I think you can run wxPython
applications interactively but Pycrust isn't as robust as I'd like.

HTH.

cheers,
prabhu



More information about the vtkusers mailing list