Re: eval string

2010-09-30 Thread Peter Otten
Peter Otten wrote: > exec 'import sys\nsys.stderr.write("completed!\n")' Oops, you need to escape the backslashes for newlines inside quotes inside quotes: >>> exec 'import sys\nsys.stderr.write("completed!\\n")' completed! Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: eval string

2010-09-30 Thread Thomas Jollans
On Thursday 30 September 2010, it occurred to Brandon Harris to exclaim: > Needing to pass a string command into a third party program and having > issues creating a string to do what I need. > > here's what I have so far. > > eval('import sys; > sys.stderr.write(\'\n\n\nCompleted!!!\nCompleted

Re: eval string

2010-09-30 Thread Peter Otten
Brandon Harris wrote: > Needing to pass a string command into a third party program and having > issues creating a string to do what I need. > > here's what I have so far. > > eval('import sys; > sys.stderr.write(\'\n\n\nCompleted!!!\nCompleted!!!\nCompleted!!! \nCompleted!!!\nCompleted!!!\nCo

eval string

2010-09-30 Thread Brandon Harris
Needing to pass a string command into a third party program and having issues creating a string to do what I need. here's what I have so far. eval('import sys; sys.stderr.write(\'\n\n\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\n\n\n\');') Traceback (