How do I pass a variable to an external program

Rigga Rigga at noemail.com
Fri Oct 10 16:07:03 EDT 2003


Cameron Laird wrote:

> In article <shDhb.330$%93.304 at news-binary.blueyonder.co.uk>,
> Rigga  <Rigga at noemail.com> wrote:
>>Hi
>>
>>I would like to pass a variable to an external program i.e.
>>
>>os.system('cd $variable')
>>
>>However this doesnt work, I cant figure it out, any ideas?
> .
> .
> .
> 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')






More information about the Python-list mailing list