Re: Confusion About Classes

2005-01-01 Thread flamesrock
Well, I took a short excursion into xml for a different part of the program, but the class is now finished!! (source below) I have a few more questions for you guys. 1)If I set self.serverConfig = file(os.path.join('configuration','score.conf'), 'w') and then go self.serverConfig.close(), is there

Re: Confusion About Classes

2004-12-30 Thread Steve Holden
Steven Bethard wrote: M.E.Farmer wrote: there are no variables in python [...] As M.E.Farmer mentioned, you can't remove underscores on special method names like __init__. However, when you're declaring an instance variable, e.g.: self.__xyz = True then you're choosing the name here, so you

Re: Confusion About Classes

2004-12-29 Thread Steven Bethard
M.E.Farmer wrote: there are no variables in python While it's true that in Python it's more appropriate to talk about names and bindings instead of variables and values, there is a parallel, and you can get a fair distance without having to fully convert to the names/bindings terminology. That

Re: Confusion About Classes

2004-12-29 Thread M.E.Farmer
Thanks for the followup, I just wanted to mention that you still need to read that stuff thru several times, because... there are no variables in python (yea I know others will say otherwise ;) Yep, I said it, none. There are NAMES, thats why there are NAMESPACES. A name is just a reference or 'han

Re: Confusion About Classes

2004-12-29 Thread flamesrock
Thanks for the responses! And sorry for the late reply, I had to force myself away from the computer for a day. M.E.Farmer, Yes I've been having a little bit of trouble with name spaces, but this self thing is actually starting to make sense the more I think about it -- I hadn't thought too much a

Re: Confusion About Classes

2004-12-27 Thread M.E.Farmer
flamesrock wrote: [snip] > 3) Can I create a configParser object and just call self.parser.set() > inside the function without passing it as a parameter, or do I pass it > as a parameter and call it as parser.set (without the 'self' > statement.) > > Basically..I'm confused on the proper use of 'se

Re: Confusion About Classes

2004-12-27 Thread Steven Bethard
flamesrock wrote: Hi, I've been playing like mad with all sorts of python modules..but I still can't seem to get my head around the proper use of a class and self. The question stems from this code I made(snippet): [snip misaligned code] When posting to c.l.py it's greatly appreciated if you use sp

Confusion About Classes

2004-12-27 Thread flamesrock
Hi, I've been playing like mad with all sorts of python modules..but I still can't seem to get my head around the proper use of a class and self. The question stems from this code I made(snippet): -- import httplib