z99 / vimpdb

Automatically exported from code.google.com/p/vimpdb
0 stars 0 forks source link

Is there a way to see script output? #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Is there a way to see debugging script output? I.e. I would like to be able
to see stdout when executing 'print "Hello, World!"' line.

For now F4 on the 'print "Hello, World!"' line generates the following message:

PyntaxError: unexpectedEOFgwhileeparsingg(<string>, line 1).

VIM 7.2.209

Original issue reported on code.google.com by ibragim....@gmail.com on 25 Jun 2009 at 4:31

GoogleCodeExporter commented 9 years ago
There's a workaround
wrap your code with following:
# redirect stdout to a file stdout.log
import sys
save_sys_stdout = sys.stdout
sys.stdout = open( 'stdout.log', 'w' )

...

# restore
sys.stdout.close()
sys.stdout = save_sys_stdout

Original comment by shpitaly...@gmail.com on 26 Mar 2013 at 9:13