I am importing a settings.py file into browser.py, like so:
import settings
But when I run the browser.py file then it opens settings.py before it runs browser.py, and I don’t want settings.py to run. Is there a way to stop settings.py from running, while still importing settings into browser.py?
>Solution :
Any python code outside functions and classes will be automaticly ran when you import the settings file.
You can try put the code that you don’t to be executed inside a function in the settings file and then calling those functions in browser.py as you need them.