Python Forum

Full Version: passing a value to imported code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i would like to pass a value to imported code in order for it to make a decision at import time (such as which way to define a function). the first way i tried was to set the value as a global variable before doing the import and accessing that variable inside the module very early. could this be because i am using from modulename import functionname to do the import?