Passing ‘Global Variable’ across the files in Python

Passing global variable – Attachment

I have encounter a situation where i need to pass a variable from one file to another file. This is like passing global variable across the files. I’ve created three files to demonstrate this as follows,   # name of the file
import subfile1
import subfile2
print(settings.x)     # name of the file
x = 0
def globle_pas():
global x
x = 1 # Default value of the ‘x’ configuration setting     # name of the file
import settings
def change_glob_var():
settings.x = 9