system command

Egbert Bouwman egbert at bork.demon.nl
Fri Jun 14 04:26:58 EDT 2002


    
On Thu, Jun 13, 2002 at 07:19:48PM +0200, Thor wrote:
> Having this code
>  
>   print "source "+root+".in"
>   os.system("source "+root+".in")
> 
> the script does not run the root+".in" file, but copying and pasting the 
> output form teh 1st line work.. what i'm doing wrong? Thanks in advance

I cannot reproduce your error, all goes well.
First I made a bash script called hallo.in, with only one line in it:

echo Hello, this hello.in

and next in the interactive python shell:

>>> import os
>>> root='hello'
>>> print "source "+root+".in"
source hello.in
>>> os.system("source "+root+".in")
Hello, this hello.in

egbert

-- 
Egbert Bouwman - Keizersgracht 197 II - 1016 DS  Amsterdam - 020 6257991
========================================================================





More information about the Python-list mailing list