Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
7 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
MrsTooTac:
family no family friends no friends idec yall all can smd .
Midnight97:
My drawing sure changed over the years look at these two pictures from 2024 to no
MrsTooTac:
I'm in my prime fuh all uu bum ahh ninjas omd ud83dude02ud83dude4fud83cudffe .
EdwinJsHispanic:
"poem" love is So Beautiful to have. But it's so hard to have. At this point I don't know whether its worth the wait Or if it's just millions of miles to re
EdwinJsHispanic:
"poem" love is So Beautiful to have. But it's so hard to have. At this point I don't know whether its worth the wait Or if it's just millions of miles to re
Demon25:
Yeah, I guess I'm a disappointment, doin' everythin' I can I don't wanna make you
Breathless:
I don't know if this would be considered art, but its close enough I believe, Any
6 minutes ago
0 Replies
0 Medals
4 hours ago
2 Replies
0 Medals
1 day ago
0 Replies
0 Medals
3 hours ago
1 Reply
0 Medals
1 day ago
0 Replies
0 Medals
3 days ago
1 Reply
0 Medals
3 days ago
3 Replies
0 Medals