[Tutor] Returning multiple values from a script

Hans Dushanthakumar Hans.Dushanthakumar at navman.com
Wed Jan 11 23:18:42 CET 2006


Hi,
   Can a script return multiple values to the os?

What I have in mind is something like the following:


1) Test.py
-------
import sys

r = 7
sys.exit(r)
# What I really want to do is something along the lines of sys.exit(r,
"Hans")



2) Script1.py (This script executes script test.py and prints out its
exit code): 
----------
import os

t = "test.py"
res = os.system('"python test.py")
print res



Thanks,
Hans


More information about the Tutor mailing list