Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
48 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
xXMarsXx:
His ABC's. A is for how attractive you were. B is for how you went behind my back.
zanesafoodie:
mirrors and broken glass reminds me of nothing but my past I take a deep breath b
BadBunnyHalftime:
Poem: A Loss Of Time All lives are due to end someday, they could be ended maybe in each and every way.
BadBunnyHalftime:
Was asked this by a teacher for the exit ticket, I have no idea what this could possibly be.
CozyLittleBug:
What is it called when you know there's a god, but you're not sure if you want to
penguin:
this is what he once said to me I always thought I would grow up alone But sudden
laylasnii13:
My song: still broke by: me Verse 1 I learned how to bleed quiet So nobody heard the sound I learned how to smile pretty While I was breaking down I carried
14 minutes ago
7 Replies
1 Medal
4 hours ago
10 Replies
0 Medals
40 minutes ago
4 Replies
0 Medals
4 hours ago
8 Replies
1 Medal
14 hours ago
6 Replies
1 Medal
2 days ago
19 Replies
0 Medals
20 hours ago
14 Replies
1 Medal