Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
63 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
semilore:
hi guys give me some motivational words for me drawing comp
happyday09:
here, y'all can read the book I wrote, I'm getting it published soon. please don't edit, thanks https://www.
Subshilava:
What is the difference in the total amount saved after three years can someone ex
gingy57016:
Love sucks Left on read for days Are we together still Or is everything a lie Love sucks No text back No text first Love sucks I want you to truly love me I
Trin2636:
My vocal glasses, lightning rod daylight saving time which phrase is to the colon
irelynn:
bifocal glasses efficient stove fire department Poor Richard's Almanack Which statement best describes this list of items? Responses All were created by Tho
7 hours ago
3 Replies
0 Medals
3 hours ago
6 Replies
2 Medals
1 day ago
5 Replies
3 Medals
23 hours ago
26 Replies
1 Medal
1 day ago
2 Replies
1 Medal
2 days ago
3 Replies
0 Medals