Python Forum
passing a value to imported code - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: passing a value to imported code (/thread-13107.html)



passing a value to imported code - Skaperen - Sep-28-2018

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?