execfile return values

E

Enrique

Hello all!
I've a little and no important question:
Suppose 2 scripts

##ex.py###
a=execfile('scr.py')
print "return value: ", a

##scr.py###
print "i'm scr.py"

Executing that, a takes None value.
Is there a way to handle the execution of the script ordered by the execfile
statement??

Another way that def & return in functions.

Thanks

Enrique (Madrid)




**AVISO DE CONFIDENCIALIDAD**
La información contenida en este mensaje y archivos es privada y confidencial estando dirigida solamente al destinatario. Si Ud. ha recibido esta información por error, por favor, proceda a su inmediata destrucción. Cualquier opinión o punto de vista contenido en este mensaje corresponde al remitente y necesariamente no representa la opinión del GRUPO XEROX.
 
T

Terry Reedy

'''
##ex.py###
a=execfile('scr.py')
print "return value: ", a

##scr.py###
print "i'm scr.py"

Executing that, a takes None value.
'''
As documented in Lib Ref 2.1 Built-in Functions. If you have not read
the execfile doc, please do, or reread. If you have read (or reread),
tell us what part you do not understand.
Is there a way to handle the execution of the script ordered by the
execfile statement??

I do not understand 'handle the execution of'. What you are trying to
accomplish that did not happen?

Terry J. Reedy
 
D

Dennis Lee Bieber

Terry Reedy fed this fish to the penguins on Friday 03 October 2003
07:19 am:
I do not understand 'handle the execution of'. What you are trying to
accomplish that did not happen?
At a guess, I'd say he wants 'a' to have the contents of stdout ("i'm
scr.py").


--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

python As400 2
xls to txt 2
python & debian 2
seek in a zip file?? 2
diferences between 22 and python 23 1
need help before... 0
How to convert float to sortable integer in Python 2
MySQL interface problem 0

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top