#python - Fri 23 Feb 2007 between 00:09 and 00:21

NY Lost Funds



ironfroggyproqesi`: thats what you do to read
proqesi`ironfroggy: what's what I do to read?
nictukuw+
ahavecould someone help me turn this code into a class? http://rafb.net/p/KWUBc838.html
i made an attempt, but have some issues
proqesi`hmm... funny the doc doesn't say whether it should be r+ or w+ but I'm pointed to the doc for a simple question it doesn't answer
nictukuit says use + if you want to read and write simultaneously
and says that to create files you need write. so, go for w+ :-)
ironfroggyahave: name the first issue then
proqesi`yes, but it doesn't say that r+ will throw, and w+ will create the file
ahaveironfroggy, on linke 71 of that file i posted...
ironfroggy, i am calling a function i defined earlier.
ironfroggywell you didnt really define it, but yeah?
ahaveironfroggy, now when i try and paste the code into a class object, i am not able to call that same function in the same manor
ironfroggyyou are just copying this all straight into the body of a class?
ahaveironfroggy, yes, i did not really define it.. perhaps that is my problem?
ironfroggyor do you mea you're putting it into your __init__ method?
ahaveironfroggy, yes: http://rafb.net/p/MRU0tR93.html
into its own class
with its own init
but when i get to that line 71... NameError: global name 'Request' is not defined
JohnQdoes pop raise an exception on an empty list?
ahavei assume bc i define it inside the init routine and not make it an attached member of the class?
ironfroggybecause the locals of one function are not accessable from another
ahave: exactly
ahaveironfroggy, yes. how can i make it public?
bytecolorIndexError: pop from empty list
JohnQSwanky
ahavei have some C++ background.. so i am trying to adapt to python syntax
ironfroggyJohnQ: you know what? i know the answer, but its so much easier for you to just type [].pop() in the interpreter, so go do that.
ahave: well one thing to remember is that the self. (python's version, kind of, for this->) is not implicit
JohnQironfroggy: and if bytecolor hadnt already answered me, all Id have to to is paste yours :-)
ahaveok
ironfroggyJohnQ: just pointing out that questions like that are easier and more reliably answered by the real deal.
ahavebut a self.Request will not work either
JohnQI got the point. thanks
bytecolorIPython is your best friend
ironfroggyahave: why not?
koshself.REQUEST works in zope :)
ahaveironfroggy, idk. that is why i came here for help :)

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 

IrcArchive

NY Lost Funds