467,074 Members | 939 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

execfile return values

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.

Jul 18 '05 #1
  • viewed: 4968
Share:
2 Replies
"Enrique" <en************@xgs-spain.com> wrote in message
news:ma**********************************@python.o rg...
'''
##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
Jul 18 '05 #2
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").
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jonathan | last post: by
1 post views Thread by Bo Jacobsen | last post: by
3 posts views Thread by v.vayer@gmail.com | last post: by
2 posts views Thread by Alex Popescu | last post: by
1 post views Thread by Fernando Perez | last post: by
5 posts views Thread by George Sakkis | last post: by
1 post views Thread by moijes12 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.