|ironfroggy||anyone have very good knowledge of del.icio.us? particularly, are there tag conventions for foo:bar and @baz ?|
|MrNormS||urgh... somewhere in my code some function is returning None instead of what it is supposed to return... I hate when I do that|
|terr_||IF there is a python programmer here (familiar with perhaps IDLE) I'd like to know how to list a program I created interactively... I get the entire log of the session. Code is embedded... I want to separate the code and save it.|
|darkgreen|||fwiw, ipython has a history|
|terr_||I'm a python newbie. I used idle. Is this running ipython?|
|darkgreen|||ipython is an interactive interpreter, run on command line|
|terr_||darkgreen|: Well - I have no idea what version of python idle ran. It seems to work ok tho... I can't find a history command or any command to list the code I wrote|
|darkgreen|||my information won't help you recover your program, I don't think IDLE has a history, but I havn't used it for awhile|
|terr_||I havn't lost it - I logged the session and I can pull it into emacs and clip it out.|
|darkgreen|||OK, I see what you mean with the '>>>' and extraneous output... looks like a messy job. :)|
|terr_||the code is sitting in the interpreter. it will allow me to edit it nicely... so it has it.|
there has to be a way for it to spill its gutz
I'm looking in help()... under topics. I don't see anything much of interest
|ironfroggy||terr_: basically, thats not how it works. interactive is interactive, not static. if you want to keep your code, write it in a file in the first place.|
ironfroggy: its GOT the code... how else can it execute it?
its in pyshell I think... if I can find it.
can I list all objects in a program?
|ironfroggy||yeah its there, in the readline history.|
|terr_||the interpreter is not running the readline history.|
|ironfroggy||you can get a list of names combined from the current local scope and module with dir()|
no, its running the line as you hit enter, then its just in the history.
do you think, for example, that the body of a function still has its source code, and that otherwise you couldnt execute that function when its called?
|terr_||ya. its got my code in a few objects and dir() listed them.|
how can I print an object
|ironfroggy||it does not execute your source|
|terr_||>>> print V_SGI|
<function V_SGI at 0x408b0684>
|ironfroggy||you enter the source, and it compiles it into bytecode, and it throws away your source and executes the bytecode.|
there are ways of getting the source of a function, but they actually just extract it from the source file.
|terr_||however if I click on any line in the buffer I get to edit the code....|
|ironfroggy||the source file which, in this case, does not exist.|
|terr_||so how does the shell find the source for the function-object?|
|ironfroggy||it doesnt need the source.|
it never uses that
i mean, not after the initial compiling.
|terr_||so where does it find the text for me to edit?|
|ironfroggy||its just in the buffer of the shell|
|terr_||ironfroggy: are you saying the shell parses the buffer?|
|ironfroggy||python has little or nothing to do with that at all|