Re: python syntax:urgent

2008-01-08 Thread Marc 'BlackJack' Rintsch
On Tue, 08 Jan 2008 10:03:56 +0100, Jeroen Ruigrok van der Werven wrote:

> -On [20080108 09:42], mpho raborife ([EMAIL PROTECTED]) wrote:
>>subprocess.Popen(["gmmscore", "-i", Input, "-l", List, "-t",
>> modeltype, "-m", str(mixture), "-d", str(dimension), "-v", str(vfloor),
>> "-n", str(number), "-r", str(results)])
> 
> "gmmscore", "-i" seems a bit silly, why not just "gmmscore -i"?

That's definitely *not* silly but the way to go.  There are two ways: The
above that calls the executable with the arguments as given, or with a
string like you suggests which is interpreted by a shell, so the arguments
must be escaped for that shell.  Which shell?  Depends on the system!

> You can always do something like (assuming all arguments are strings, adjust
> accordingly):
> 
> s = "gmmscore -i %s -l %s -t %s -m %s -d %s -v %s -n %s -r %s" %
> (Input, List, modeltype, str(mixture), str(dimension), str(vfloor),
>  str(number), str(results))
> 
> subprocess.Popen([s])

Here you are trying to start a program named "gmmscore -i ..." with no
arguments.  That fails (unless you really have a program with that name.  ;-)

Ciao,
Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python syntax:urgent

2008-01-08 Thread Jeroen Ruigrok van der Werven
-On [20080108 09:42], mpho raborife ([EMAIL PROTECTED]) wrote:
>subprocess.Popen(["gmmscore", "-i", Input, "-l", List, "-t",
> modeltype, "-m", str(mixture), "-d", str(dimension), "-v", str(vfloor),
> "-n", str(number), "-r", str(results)])

"gmmscore", "-i" seems a bit silly, why not just "gmmscore -i"?

You can always do something like (assuming all arguments are strings, adjust
accordingly):

s = "gmmscore -i %s -l %s -t %s -m %s -d %s -v %s -n %s -r %s" %
(Input, List, modeltype, str(mixture), str(dimension), str(vfloor),
 str(number), str(results))

subprocess.Popen([s])

-- 
Jeroen Ruigrok van der Werven  / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/
Few are those who see with their own eyes and feel with their own hearts...
-- 
http://mail.python.org/mailman/listinfo/python-list

python syntax:urgent

2008-01-08 Thread mpho raborife

Anyone please help me get this syntax right

subprocess.Popen(["gmmscore", "-i", Input, "-l", List, "-t",
 modeltype,
> "-m", str(mixture), "-d", str(dimension), "-v", str(vfloor), "-n", 
> str(number), "-r",
 str(results)])



   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.-- 
http://mail.python.org/mailman/listinfo/python-list