[Tutor] Re: Cut and paste from interpreter

Andrei project5 at redrival.net
Tue Sep 30 21:51:20 EDT 2003


John Duarte wrote:

> What is the best way to cut and paste code from the interpreter?
> Is there a way to print the history of an interpreter session?
> 
> I am looking for an efficient way to cut and paste code after working it out 
> within an interpreter session. For example, after working out a successful 
> function would there be a way to print a formatted representation of that 
> function from within the interpreter?

I'd say the selection/clipboard capabilities rather depend on the interpreter 
and OS. If you have wxPython, use PyCrust and go to the "Session" tab. E.g. 
here's a session recorded in that tab:

import re
5+5
for i in range(5):
     print i,

And here it is how it looks in the shell part of PyCrust, where it was actually 
typed:

 >>> import re
 >>> 5+5
10
 >>> for i in range(5):
...     print i,
...
0 1 2 3 4

-- 
Yours,

Andrei

=====
Mail address in header catches spam. Real contact info (decode with rot13):
cebwrpg5 at bcrenznvy.pbz. Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq gur 
yvfg, fb gurer'f ab arrq gb PP.





More information about the Tutor mailing list