Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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'
Comment

PREVIOUS NEXT
Code Example
Python :: how to for loop for amount in list python 
Python :: How to combine train and Test dataset in python 
Python :: dataframe to ftp 
Python :: legend matplotlib 
Python :: python convert hex number to decimal 
Python :: jupyter notebook show full dataframe cell 
Python :: relativefrequencies of the unique values pandas 
Python :: python turtle jupyter notebook 
Python :: python integer to string 
Python :: font in tkinter 
Python :: Matplotlib rotated x tick labels 
Python :: group by, aggregate multiple column -pandas 
Python :: ord python 
Python :: Math Module tan() Function in python 
Python :: create series in pandas 
Python :: python download file from url requests 
Python :: how to print keys and values of dictionary together in python? 
Python :: add cooldown to command discord.py 
Python :: how to give a role permissions discord py 
Python :: oversampling using smote 
Python :: count occurrence in array python 
Python :: python how to turn a word into a list 
Python :: get current domain name django 
Python :: python regex search file 
Python :: planets list 
Python :: how to take float input upto 2 decimal points in python 
Python :: Sum items in a list with ints and strings in python 
Python :: ffill dataframe python 
Python :: # decorator 
Python :: how to get a dictionary in alphabetical order python 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =