#python - Mon 23 Apr 2007 between 04:33 and 05:05

NY Lost Funds



Jeruband mylistofverticies.remove((x,y,z))
and mylistofverticies.append((x,y,z))
gumby600mCool, I'll check that out
another question: is there a way of overloading the "[]" operator in Python?
Leedsgumby600m: don't overload it - implement it
gumby600mLets say I make a mesh class. every mesh consists of polygons. I want to access polygon[5] or polygon[13], ...
Leeds: How do I do this? "def [](x,y)"???
TFKylegumby600m: yeah, see http://docs.python.org/ref/sequence-types.html (the *item__ funcs there)
nir_ai...started the emacs tutorial... let's see if I am not too old an emule.
I wonder if it will kill too many brain cells.
Jerubgumby600m: __setitem__/__getitem__/__delitem__
gumby600mCool, thx!
Jerubgumby600m: but hey, this is easier done using a dict and tuple keys
oh, right, sorry. no, I misunderstood.
TFKylegumby600m: though, I don't see why a list wouldn't work there
azadderI want to be able to type "python" from the command line -- do I have to set it up as a environment variable?
guido_gazadder: you need to put the path to the executable into the PATH env. var.
azadderhmm...
case sensitive?
guido_gdepends on you os
*your
azadderI am trying everything I can think of, not working here -- I am going to look for a tut online, thanks man
TMLazadder: What OS are you on?
azadderXP, I am using this line in the PATH variable C:\Program Files\Nmap;C:\Python25\python.exe
ivan`PATH lists directories
TMLTake "python.exe" off
azadderhmm
TMLC:\Python25\
azadderthank you very much
TMLYou also might need to log out to make Windows completely see the change
azadderit's working now, no logout needed -- if I would have read guido_g's first statement better, I would have noticed he said "path"
boy, do I feel dumb -- thanks for the information
gumby600mOkay, new set of questions about lists in python:
Let's say I do the following: myList.append(150)
is there any way of automagically figuring out what index in myList that corresponds to?
(i.e. so I could do myList[0], which would properly report "150"?
beantmtwell, if you appended it
it will be len(myList)
gumby600mit feels like there should be a fancier way of doing it....
like, I would expect the language to have something like "key = myList.append(150)"

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

IrcArchive

NY Lost Funds