How do I pass a variable to an external program

Rigga Rigga at noemail.com
Fri Oct 10 16:24:35 EDT 2003


Cameron Laird wrote:

> In article <guDhb.342$%93.301 at news-binary.blueyonder.co.uk>,
> Rigga  <Rigga at noemail.com> wrote:
>>> .
>>> .
>>> .
>>> In the short term,
>>>   os.system('cd %s' % variable)
>>> is probably what you think you want.
>>Wow thanks for the fast response that works a treat, now i just gotta find
>>out how you run more than one command on a line i.e.
>>os.system('cd %s' 'ls -lt')
>>
>>
> 
>   os.system('cd %s; ls -lt' % variable)
> 
> To save even more time, visit <URL: http://
> www.python.org/doc/current/tut/tut.html >.
Thanks Cameron your help and patience has been appreciated.

Regards

Rigga




More information about the Python-list mailing list