python - Importing Modules vs. Executing Scripts for Global Variables -
is bad practice execute script execfile(xx.py), rather import xx module? reason i'm interested, executing file puts functions directly __main__, , globals available without needing explicitly pass them. but, i'm not sure if creates trouble... thanks!
yes, it's bad practice, reason ends in __main__. if have 2 modules have variable same name, 1 overwrite other.
Comments
Post a Comment