1

i have a python script, that connects to a web service using suds client, and gets data. Now based on what was queried, i can get a true or false as results. so when i run the script with correct data values, i get nothing on the stdout, but when i use incorrect data, i get "data error", based on :

except Exception, e:
    print 'data error'

Is there a way to get the values of success and failure from a python script, so in case of failure, i can notify the user. I am referring to the return values frm a failed/success python script

1 Answer 1

3

What you get on stdout is what you print in your script (so in your case, you will get 'data error' on stdout in case of error).

If you want to handle correctly the return code of you python script, take a look to the sys.exit(return_code) method which will return to the caller the return_code (in general 0 when all is OK, something else when something bad happend)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.