[Tutor] code blocks and output streams

Daniel Ehrenberg littledanehren at yahoo.com
Sun Nov 9 11:30:32 EST 2003


I am trying to create a program that can have php-like
embedding of Python in html files. First, I want to
start out with a program that can take an html file
with python code inside <py> tags (ie something like
<py>print 'hi'</py>). In trying to do this, I found
two problems:  executing complex code blocks (eg ones
that must have some indentation) and creating a new
output stream to direct things that are printed to.
All I know about how to do this is that the exec
keyword should be used to execute things and that I
should change sys.stdout to change the output stream.

Daniel Ehrenberg

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree



More information about the Tutor mailing list