Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
11 Online
How do u share global variables across modules using py? :-?
Still Need Help?
Join the QuestionCove community and study together with friends!
Modules are a complex topic in Python. See http://docs.python.org/tutorial/modules.html for a full description. But in really simple terms, if you define a variable XX in module M, you can use it by first importing M, then reference the variable as M.XX: In M.py: XX = 17 In use_m.py: import M print M.XX
Can't find your answer?
Make a FREE account and ask your own questions, OR help others and earn volunteer hours!
Join our real-time social learning platform and learn together with your friends!
Join our real-time social learning platform and learn together with your friends!
Latest Questions
jinxthelovely:
In shadows deep, where silence dwells, A weary heart, in whispered spells, The days bleed gray, the nights are long, In tangled thoughts, I drift along.
auggie:
my sixteenth b-day is next week!!! I'ma be counting down the days >w
Twaylor:
-REMINDER- NASA IS GOING BACK AND PAST THE MOON TODAY, THE FUTHEST HUMANS HAVE EVER GONE, SEE THE LAUNCH LIVE : https://www.
JusJeyk:
Hey everyone! @ultrilliam has added the QuestionCove April Fools Update! Things around the website may act strange, if you do not want this you can enter th
prettygirl15:
dr.ridel indentifies three potential knights in shining armor that might keep misinformation and uninformed disingnous messnget at bay away these include A.
4 hours ago
4 Replies
2 Medals
7 hours ago
4 Replies
1 Medal
10 hours ago
15 Replies
1 Medal
17 hours ago
5 Replies
4 Medals
1 day ago
2 Replies
0 Medals