[PATCH] Some new stuff

Discussion in 'Python' started by Christos TZOTZIOY Georgiou, Nov 13, 2004.

  1. Hi Stelios.
    You might like to take a look at IPython then:

    If you don't have an account already in sourceforge.net (where Python
    sources are located so far), you could create one, and submit your
    patches there; you might also want to subscribe to the Python-Dev
    mailing list:


    since your post would be considered more on-topic if posted there.
    Nonetheless, you are most welcome as a contributing pythonista
    ("santinista pou'xw" - non-greeks forgive my greeklish pun :)
    Christos TZOTZIOY Georgiou, Nov 13, 2004
    1. Advertisements

  2. Hi all.

    Basically, I'd like to use python as my system shell. It's not suitable
    for a general purpose shell but since it is very programmable it can
    eventually do whatever bash does and even more.

    One thing I'd like python to do is: attach the *python code* of a
    function to a function object. The same for class.

    This can be done in python as it is but it doesn't feel very right. I
    think it should be the job of the parser. So there is a patch vs 2.3.4 at:

    With this patch when the command line option -P is passed to python,
    all functions and classes have an extra member __pycode__ which is the
    code of the thing!

    This is very exciting because if combined with a function 'save()' which
    looks for all the functions/classes in globals(), takes their __pycode__
    and saves it to a file (along with it's own code: save.__pycode__) can
    lead to a really fun Python Incremental Expert System Shell.

    Such a sample system is also included in the tar file.
    For example we can say:
    lsfunc() # lists all functions
    pr (lsfunc) # prints definition of lsfunc
    ed (pr) # edits the function 'pr'
    save () # saves all and we go to sleep


    Stelios Xanthakis, Nov 14, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.