Re: Run a external program.

2009-11-14 Thread Terry Reedy
Top-posting makes things more confusing. You cannot pass a Python file object to an external process. Pass the name instead. Yasser Almeida Hernández wrote: So, how can i pass an argument as a variable in this context...? Quoting MRAB : Yasser Almeida Hernández wrote: Hi all!! I'm writin

Re: Run a external program.

2009-11-14 Thread Yasser Almeida Hernández
All ran ok!! Thanks a lot Quoting MRAB : Yasser Almeida Hernández wrote: So, how can i pass an argument as a variable in this context...? You can't pass arbitrary values on a command line. In this case, why not just pass the path of the file? s = 'command "%s" -i file2 -w 1.4 -o file3.ou

Re: Run a external program.

2009-11-14 Thread MRAB
Yasser Almeida Hernández wrote: So, how can i pass an argument as a variable in this context...? You can't pass arbitrary values on a command line. In this case, why not just pass the path of the file? s = 'command "%s" -i file2 -w 1.4 -o file3.out' % file1 Quoting MRAB : Yasser Almeida H

Re: Run a external program.

2009-11-14 Thread Chris Rebert
> Quoting MRAB : >> Yasser Almeida Hernández wrote: >>> >>> Hi all!! >>> >>> I'm writing a script where i call a external program which receive  some >>> arguments. >>> One of this arguments is stored in a variable, that is passed as >>>  argument as well: >>> >>> import os >>> ... >>> f = open(fil

Re: Run a external program.

2009-11-14 Thread Yasser Almeida Hernández
So, how can i pass an argument as a variable in this context...? Quoting MRAB : Yasser Almeida Hernández wrote: Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well:

Re: Run a external program.

2009-11-14 Thread Mark Tolonen
"Yasser Almeida Hernández" wrote in message news:20091114142611.sj45qput2c84s...@correo.fenhi.uh.cu... Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well: import os

Re: Run a external program.

2009-11-14 Thread MRAB
Yasser Almeida Hernández wrote: Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well: import os ... f = open(file1, 'r') s = 'command $f -i file2 -w 1.4 -o file3.out' os.s

Run a external program.

2009-11-14 Thread Yasser Almeida Hernández
Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well: import os ... f = open(file1, 'r') s = 'command $f -i file2 -w 1.4 -o file3.out' os.system(s) ... When i run the sc