I don't know what exactly your python script is doing and what kind of
return value you have,

Let's assume your python application prints nothing to stdout, then
python could print out the return value and you could get it with the
back ticks (reverse single quote)
(at least for sh bash csh tcsh and probably also for ksh and some others)




Example
>>>>>>>>>> beginning of python script numtotext.py
import sys
a=['zero','one','two','three']
b = int(sys.argv[1])
###your python script can still print to stderr if it likes to
print >> sys.stderr, "I am no converting"
result = a[b]
print result
>>>>>>> end of python script


>>>>>beginning of shell script
#!/bin/sh

num=2
text=`python numtotext.py $num`
echo "$num as text is $text"
>>>>> end of shell script

bye


N


devi thapa wrote:
> Hi,
> 
> I am executing a python script in a shell script.  The python script
> actually returns a value.
> So, can I get the return value in a shell script? If yes, then help me out.
> 
> Regards,
> Devi
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to