regarding system function

praba kar prabapython at yahoo.co.in
Fri Apr 22 03:35:33 EDT 2005


--- Robert Kern <rkern at ucsd.edu> wrote:
> praba kar wrote:
> > Dear All,
> > 
> >      In Php If I send a command to system function
> > then It will return 1 on success and 0 on failure.
>  So
> > based upon that value I can to further work.
> > 
> >      But In Python If I send a command to system
> > function then It will return 0 only for both
> > conditions(success and failure).
> 
> Are you sure about that?
> 
> In [3]:os.system('cat foo')
> cat: foo: No such file or directory
> Out[3]:256
> 

I agree above statement but When I delete a directory
os.system('rm -rf test')
0
if directory is not present then I again try to
delete
os.system('rm -rf test') 
now this time also It will print
0


________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony



More information about the Python-list mailing list