0

I have a bit of a weird use case where I need to have as little code as possible in my primary script. (many inexperienced people will edit hundreds of these scripts spread out amongst hundreds of devices)

I am trying to optionally set a variable which will be used in an import, but without forcing these many people to remember to pass it to a function every time.

Here's my pseudo code, how can I make this work?

myimport.py
-----------
isdebug = False
def myfunction()
    if isdebug:
         print("do something")
      
         
mymain.py
---------
import myimport
myimport.isdebug = True   # I want this variable set in myimport.py

0 Answers0