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
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
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
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 (