python global variable across files code example
Example 1: python global variables
global var1
var1 = 'whatever'
Example 2: python global variable across files
# config.py
x = 0
# mod.py
import config
config.x = 1
# main.py
import config
import mod
print(config.x) # will print '1'