dynamic stdout

Russell E. Owen owen at nojunk.invalid
Sat Feb 8 12:31:22 EST 2003


In article <87e16163.0302061416.4c6cce16 at posting.google.com>,
 jsun at alxnsd.com (Jeffrey) wrote:

>Hi All, 
>I have a quick problem with hopefully a straight forward solution.  I
>just want to print a variable to the command line but have that line
>that's printed to the screen, change values whenever the variable
>changes in the program.  I hope I haven't been too confusing
>describing this.

Are you willing to use a setter function to set the variable? If so, 
it's trivial. This sort of thing is also commonly done for GUIs -- have 
a variable holder and set the variable's value via a setter function. 
Then you can automatically call callbacks or print the new value or 
whatever you want to do.

If not, I think you are out of luck for normal execution. The debugger 
might help, or perhaps deep knowledge of the internals of Python. I'm 
not familiar with either.

-- Russell




More information about the Python-list mailing list