Resetting Global Variables? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Resetting Global Variables? (/thread-13117.html) Pages:
1
2
|
RE: Resetting Global Variables? - volcano63 - Sep-28-2018 Use OOP, with properly designed classes. And write according to PEP-8 - because otherwise quite a few Pythonista (myself included) will refuse looking at your code RE: Resetting Global Variables? - WuchaDoin - Sep-28-2018 (Sep-28-2018, 08:34 PM)ichabod801 Wrote: I'm going to back down to simple things, and rewrite your three function example with parameters: Oh wow. Seeing it written that way makes much more sense! Now I can see why that is more appropriate than using outright global variables. All the help is very much appreciated and saved me so much time. I will have to go back through it all to re-arrange it and setup the functions appropriately, but this will be of great use in the future. Again, much appreciated. (Sep-28-2018, 08:36 PM)volcano63 Wrote: Use OOP, with properly designed classes. I am 4 weeks new to Python. Never looked into it before hand. I began just by writing code; I never considered object orientation or any type of layout other than that I wanted it to look at least structured. But now that I am more familiar with the basics, I can see how object orientation is almost always sought(imho). I appreciate your response as well. Anything help because sometimes it can actually take while to get responses. You just saved me from asking another question in the future. |