[PATCH] Some new stuff

  • Thread starter Christos TZOTZIOY Georgiou
  • Start date
C

Christos TZOTZIOY Georgiou


Hi Stelios.
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.

You might like to take a look at IPython then:

http://ipython.scipy.org/
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:
http://students.ceid.upatras.gr/~sxanth/ISYSTEM/python-PIESS.tar.bz2

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:

http://mail.python.org/mailman/listinfo/python-dev

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 :)
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!

<snip>
 
S

Stelios Xanthakis

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:
http://students.ceid.upatras.gr/~sxanth/ISYSTEM/python-PIESS.tar.bz2

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



Cheers

Stelios
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top