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'
Yasser Almeida Hernández pedro...@fenhi.uh.cu 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
So, how can i pass an argument as a variable in this context...?
Quoting MRAB pyt...@mrabarnett.plus.com:
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
Quoting MRAB pyt...@mrabarnett.plus.com:
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')
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
All ran ok!!
Thanks a lot
Quoting MRAB pyt...@mrabarnett.plus.com:
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
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 pyt...@mrabarnett.plus.com:
Yasser Almeida Hernández