Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
6 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
EdwinJsHispanic:
(lowk started of somewhat poetic than Js started to write whatever I felt like writing) Practicing looking okay Making sure I look good for the play Skippin
EdwinJsHispanic:
(lowk started of somewhat poetic than Js started to write whatever I felt like writing) Practicing looking okay Making sure I look good for the play Skippin
Nitrox:
how long would it take for some1 to run around the earth 25 times with a 30 sec b
urfavbrunette:
The school came into view far too quickly than I anticipated. I pulled into the parking lot, my heart racing at the thought of being really late to school.
Peer0Pressures0bad:
**"The Fear of Being Yours"** I think I'm starting to like you more than I should, More than I planned to, more than I thought I could.
thereneelg:
Alright so, I took my descriptive assessment about 2 or 3 weeks ago. My tutor on PAPER.
EdwinJsHispanic:
You forgot while I remembered And maybe its me that's short tempered It hurt like
38 minutes ago
7 Replies
2 Medals
14 hours ago
0 Replies
0 Medals
1 day ago
18 Replies
0 Medals
2 days ago
3 Replies
0 Medals
4 hours ago
9 Replies
3 Medals
3 days ago
4 Replies
0 Medals
1 day ago
9 Replies
2 Medals