ipython like features in pyshell/pycrust

Nevare Stark nevare.stark at gmail.com
Sat Mar 24 12:46:36 PDT 2007


I have added some small features to pyshell/pycrust that are similar to
ipython :

- calling functions even without ending parentheses :
>>> dir
--> dir()
['__builtins__', '__doc__', '__file__', '__name__', 'a', 'filling', 'magic',
'notebook', 'pp', 'shell', 'yam', 'yaml']

- magical functions that takes the rest of the line whatever is it as a
string parameter (and I implemented a few) :
>>> pwd
'/home/nevare'
>>> cd Desktop
'/home/nevare/Desktop'
>>> exe date
'samedi 24 mars 2007, 20:11:38 (UTC+0100)\n'

- a special magical function : '?' that can be placed before or after an
object and returns its doc
>>> ?dir
Python Library Documentation: built-in function dir in module __builtin__

dir(...)
    dir([object]) -> list of strings

    Return an alphabetized list of names comprising (some of) the attributes
    of the given object, and of attributes reachable from it:

Would you be interested in having me commenting a bit my code and make a
patch that could be integrated in pyshell ?

I would also like to give it a better completion (it is limited for the time
being).

And also had some features that enable people to write python modules
entirely in a shell. Like :
export.file =3D '~/Desktop/parrot.py'
class parrot
    ...
math.__init__ =3D ...
def isDead(self,...):
    ...
math.isDead =3D isDead
math.isMoving =3D ...
export(math)

And it would export refactored source code of the math class and all its
modifications to the .py file.
Don't you think that would be cool ?

I suppose you wouldn't be interested to have me work on it for the summer of
code. (well I understand it's not really related to core of wxpython).

I may still do it someday ... if I find the time and energy.

Olivier Lauzanne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-dev/attachments/20070324=
/e1859336/attachment.htm


More information about the wxpython-dev mailing list