A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/064424.html below:

return values from scripts

return values from scripts return values from scriptsAlexis Lê-Quôc alq666 at yahoo.com
Tue Apr 17 15:28:32 EDT 2001
If you do execfile ('second.py', locals ()) and have second.py look like:

do_some_stuff ()
globals ()["x"]= 7

then the enclosing .py will have a local variable named "x", whose value is
7.

-- Alexis Le-Quoc


--- Mike Burnett <mnb at ornl.gov> wrote:
> While running a script in the python interpreter, I need to run a second
> script from the first, passing some values to the second.  I know I can
> do this with: execfile('second.py',locals()).  Is there any way to get
> back into the original script one value (a return status) from the
> second script?  Is there any way to get several parameter values back?
> 
> Mike Burnett
> burnettmn at ornl.gov
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list


=====
--
Alexis Le-Quoc
New York

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4