By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,715 Members | 768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,715 IT Pros & Developers. It's quick & easy.

Python beginner, global variables, pointers

P: 1
Hi. I've coded some stuff a long time ago, and didn't have reason to take up programming until now. I've learned Python 'on-the-go' and now ran into the idea of avoiding global variables of any kind.

Are there any basic techniques used to avoid global variables? I have a bunch of functions defined to make it easier to debug and develop. The only way I came up with is to send all the necessary variables to each function, but I'm not sure if it's the right way to go.

Also, I've missed pointers in Python. My program is a version of the maze-solver, which needs to dynamically approach multi-way intersections and search for solutions that dwell further into the 'maze'. The intersections are stored in a list of class items. Once it determines that it has reached a dead end, it needs to access previous nodes in the database. Back in BP 7.0 I would have used pointers to at least parent node, but I haven't figured out a similar solution in Python. Is there such a way?
Jul 8 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.