How to pass a multiline arg to exec('some.exe arg')?

Peter Otten __peter__ at web.de
Mon May 5 06:53:26 EDT 2008


n00m wrote:

> os:windows
> ml = 'line1 \n line2 \n line3 \n'
> exec('some.exe "' + ml + '"')
> 
> and some.exe get only 'line1'...

My crystall ball says you want

subprocess.call(["some.exe", ml])

exec is a python statement that executes python code.

Peter



More information about the Python-list mailing list