Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
34 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
XShawtyX:
Helpud83dude4f All this graphing shi hurts my head like how tf do u do this????
Jasonisyours:
What were the key causes of the French Revolution in 1789?
brianagatica14:
A phone company charges $2 for the first five minutes of a phone call and 30 cents per minute thereafter.
CherryLover:
not sure if ya'll hear of this but last year there was this girl and her name is Aubreigh Wyatt and she was bullied by a group of people and they hated her
ctomk3743:
It's another song I had in mind (please no negative comments) I walk through the rain at night as the wind blows hard and the rain pours down on me.
2 hours ago
1 Reply
1 Medal
2 hours ago
2 Replies
4 Medals
1 hour ago
5 Replies
3 Medals
2 hours ago
41 Replies
3 Medals
1 day ago
8 Replies
7 Medals