The return code

Jeff McNeil jeff at jmcneil.net
Thu Nov 13 16:38:14 EST 2008


On Nov 13, 4:12 pm, Aaron Brady <castiro... at gmail.com> wrote:
> On Nov 13, 6:15 am, "devi thapa" <devi.th... at gmail.com> wrote:
>
> > Hi,
>
> >           I am running one service in the python script eg like
> > "service httpd status".
> > If I execute this command in normal shell kernel, the return code is
> > 3. But in the python script its return code is different, ie not 3, I
> > mean to say that return codes are differing.
> > But I want the return code  3 , not the other one. So, how can I achieve this?
>
> > Regards,
> > Devi.
>
> Are you looking for sys.exit( 3 )?

Or, are you executing "service httpd status" from within a Python
script and not getting the exit code you're expecting from the command
you've spawned? If this is the case, ensure the command is actually
executing.

Can you post the actual code?



More information about the Python-list mailing list