Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- one.py:
- -------
- def my_function():
- if _debug:
- print "debugging!"
- two.py:
- -------
- from one import *
- _debug = False
- my_function()
- NameError: global name '_debug' is not defined
- constants.py
- ------------
- debug = True
- one.py
- ------
- from constants import debug
- #...
- two.py
- ------
- from constants import debug
- #...
- from one import *
Add Comment
Please, Sign In to add comment