[IPython-dev] Ipython plugin for Editra

Ronen Abravanel ronena at gmail.com
Sat Feb 28 16:52:41 EST 2009

Editra, an extensible programmer's editor written in wxPython, contain a
cool IPython plugin. This mail is a follow up for a discussion with
Laurent, The author of the plugin, in his blog, continue here
according to his
request. The Orginal discassion can be found in
at the end of this mail.

Using papi to set\redefine IPython's magic word partly do the job, The other
part is to execute some arbitrary python code inside The ipython shell.
Invoking papis "ex" method (Using papi from *ipython_panel.IP._IP.getapi() *)
let the Code run in IPython's context, but the output is printed to Editra's
stdout (The console in wich I invoked editra's from) and not in the IPython
in the shelf.  My attempts to set sys.stdout to an handler from, let say,
_term.cout or others, cused IPython to stack. futher more, the Exeption
throws while I call ip.ex, is cought within Editra and withn IPython.

Further more - I wish to change, If I can, Only IPyShell/__init__.py and not
the stuff in "IPython" dir, as it seems as a "pure" copy of IPython's
orginal source (is it?)


The orginal discassion:

   1. Ronen Says:
   February 21, 2009 at 8:18

   That’s a one cool Plugin.

   What will make it ideal, is better integration with Editra’s Editor:
   Make ipython’s %edit Open the edit-buffer in Editra’s current Windows,
   and Enable poeple to run The code they edit in Editra inside the open
   IPython windows…
   Any hint where should I try to hack in order to achieve those?

   2.  Laurent Says:
   February 22, 2009 at 10:45

   You can have access to the plugin repos:

   # Non-members may check out a read-only working copy anonymously over
   svn checkout

   The plugin name is ipyshell, in it’s directory you’ve got the whole
   ipython source + the plugin source.

   It need a little refresh for sure [image: :)] .

   If you want to try to hack it take a look @Ipython/gui/wx the whole code
   is in ipython_view and ipshellnonblocking.

   ipython_view -> gui interface
   ipshellnonblocking -> the interface with ipython

   You can add:
   ip = IPython.ipapi.get()
   def myEdit(self, arg):
   print ‘do what you want’
   ip.expose_magic(’edit’, myEdit)

   to WxNonBlockingIPShell inside ipython_view.py

   Please note that if ipython is ever installed on your system you’ll have
   to make a eggsetup.py develop to make sure to use your new local copy.

   We can discuss about all of this in ipython-dev mailing list [image: :)]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20090228/aad1e02c/attachment.html>

More information about the IPython-dev mailing list