Hi!
I was wondering if we can pass some arguments to system(cmdline)?
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
which would instruct Perl to do an ls /home/cypher
But in python, doing something like
dir=/home/cypher
system(ls dir)
would cause python
Didier C wrote:
Hi!
I was wondering if we can pass some arguments to system(cmdline)?
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
which would instruct Perl to do an ls /home/cypher
But in python, doing something like
dir=/home/cypher
system(ls
On Sun, Jun 19, 2005 at 11:12:05PM -0700, Didier C wrote:
Hi!
I was wondering if we can pass some arguments to system(cmdline)?
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
which would instruct Perl to do an ls /home/cypher
But in python, doing
Didier C wrote:
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
Is there a way to reproduce the same thing in Python?
system(ls %s % dir)
But you should really be using subprocess for security (so that if
dir==/home/foo; rm -rf / nothing bad will happen):
Thanks all for the reply. I'll try out those things out. :)
Cheers,
Didier.
Leif K-Brooks a écrit :
Didier C wrote:
E.g in Perl, we can do something like:
$dir=/home/cypher;
system(ls $dir);
Is there a way to reproduce the same thing in Python?
system(ls %s % dir)
But you
Didier Casse [EMAIL PROTECTED] (DC) wrote:
DC Thanks all for the reply. I'll try out those things out. :)
But don't try the following
system(ls $dir);
with
dir==/home/foo; rm -rf /
--
Piet van Oostrum [EMAIL PROTECTED]
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: [EMAIL PROTECTED]