eval string

Brandon Harris brandon.harris at reelfx.com
Thu Sep 30 16:21:16 CEST 2010


  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 (most recent call last):
   File "<stdin>", line 1, in <module>
   File "<string>", line 1
     sys.stderr.write('
                      ^
SyntaxError: EOL while scanning string literal


so I've changed it up every way I can think and I get other errors.

eval('import sys; 
sys.stderr.write("\n\n\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\nCompleted!!!\n\n\n");')

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "<string>", line 1
     import sys; sys.stderr.write("
          ^
SyntaxError: invalid syntax


Brandon L. Harris




More information about the Python-list mailing list