On Nov 3, 10:47 pm, Evan <[EMAIL PROTECTED]> wrote: > Hello - > > i'm trying to call subprocess.popen on the 'command-based' function in > linux. When I run the command from the shell, like so: > > goset -f ' "%s %s" name addr ' file_name > > it works fine > > however when I try to do it in python like so: > > p = subprocess.Popen(["goest",'-f \'\"%s %s\" name addr\' ', > 'file_name'], shell=True) > > It always failed. > > I also try like so: > > p = subprocess.Popen(["goest","-f '\"%s %s\" name addr' ", > 'file_name'], shell=True) > > It also failed. > > Does anybody have a good suggestion for this matter? thanks in > advance. > It looks like there are _4_ items on the command line:
goset -f ' "%s %s" name addr ' file_name so the call should be: p = subprocess.Popen(["goest", "-f", "' \"%s %s\" name addr '", "file_name"], shell=True) (Untested) -- http://mail.python.org/mailman/listinfo/python-list