subprocess and & (ampersand)

Ross Ridge rridge at caffeine.csclub.uwaterloo.ca
Wed Jan 23 15:57:36 CET 2008


Tim Golden  <mail at timgolden.me.uk> wrote:
>but this doesn't:
>
><c:/temp/firefox.bat>
>"c:\Program Files\Mozilla Firefox\firefox.exe" "%*"
></c:/temp/firefox.bat>
>
><code>
>import subprocess
>
>cmd = [
>r"c:\temp\firefox.bat",
>"http://local.goodtoread.org/search?word=tim&cached=0"
>]
>subprocess.Popen (cmd)
>
></code>

You need to use double quotes both in the .BAT file and in the string
you pass to subprocess.Popen().

					Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge at csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //	  



More information about the Python-list mailing list