execute python code and save the stdout as a string

jwaixs jwaixs at gmail.com
Sat Jun 25 14:03:44 CEST 2005


Hello,

I've a question. Can I execute a part of a python code and put it's
output in a string? Something like this:

s = ""
s = exec """print "Hello World" """
print s

Greetz,

Noud




More information about the Python-list mailing list