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


Groups > comp.lang.python > #72920 > unrolled thread

How to use imported function to get current globals

Started by1989lzhh <1989lzhh@gmail.com>
First post2014-06-08 01:40 +0800
Last post2014-06-08 01:40 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  How to use imported function to get current globals 1989lzhh <1989lzhh@gmail.com> - 2014-06-08 01:40 +0800

#72920 — How to use imported function to get current globals

From1989lzhh <1989lzhh@gmail.com>
Date2014-06-08 01:40 +0800
SubjectHow to use imported function to get current globals
Message-ID<mailman.10854.1402162815.18130.python-list@python.org>
Here is the code
m1.py
def f():
    print globals()

m2.py
from m1 import f
f()# how to get current module's globals?


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web