Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72933

Re: How to use imported function to get current globals

From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: How to use imported function to get current globals
Date 2014-06-07 18:20 -0400
References <602B90F0-E7FE-4887-ADA1-981FD4179EC7@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.10864.1402179672.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 6/7/14 1:40 PM, 1989lzhh wrote:
> Here is the code
> m1.py
> def f():
>      print globals()
>
> m2.py
> from m1 import f
> f()# how to get current module's globals?
>

Looking at the code you have posted in your two messages so far, it 
seems like you are building something very interesting and ambitious. 
Do you mind talking a bit about what it is?

-- 
Ned Batchelder, http://nedbatchelder.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to use imported function to get current globals Ned Batchelder <ned@nedbatchelder.com> - 2014-06-07 18:20 -0400

csiph-web