Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
It seems the scoping rules are much stricter than in regular python. So you would have to do something like this if you want to have that particular variable in scope to work on it.
So reference types are global but value types aren't
i.e
Thanks! I did not know Dictionaries would work! You're a life saver!
It does irritate me that we cannot modify global variables though, that should be in the game for sure.
Nevermind... You can use global variable IF they are declared in the "main" window but not anywhere else..
If you define a variable in a window and have other code in the scope of that window then it will work, but then that's not a global. As soon as you add a function and try to modify that variable it'll error as a new variable is created in the scope of that function. You can disable the error but it won't function the way you think it would.
Meaning the output of this code...:
♥♥♥♥♥♥♥ stupid
It definitely failed more than it worked. I was pondering to see if I could get a class to work but decided not to dive into Python classes and refactor my problem with the tools I knew was there.