Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get global variable by name

x = 1
y = globals().get('x')
z = globals().get('a')

x is y # True
z is None # True
 
PREVIOUS NEXT
Tagged: #python #global #variable
ADD COMMENT
Topic
Name
4+9 =