#python - Mon 7 May 2007 between 00:35 and 01:10

NY Lost Funds



Borg7ironfroggy: i tried that
ironfroggy: TypeError: 'bool' object is not callable
ironfroggy: the line i tried was: for line in itertools.takewhile(line!='@data\n',file_in):
polpakBorg7: your predicate needs to be a function
Borg7polpak: oh. how would i state that?
polpakBorg7: for line in itertools.takewhile( lambda ln: ln != '@data\n' , file_in )
ironfroggy(line for line in f if line != 'xyz')
polpakironfroggy: no, he wants to stop when he sees the string he's looking for
deltabno, that continues after a matching line
Borg7ironfroggy: correct
ironfroggyoh, right.
Borg7i want to stop
polpak: your code worked, but any way i could still include the line '@data\n'?
ironfroggylambda line: line != 'xyz' is your predicate then
polpakBorg7: nope, the takewhile consumed it
Borg7: you'd have to make your own takewhile
or use a different predicate
Borg7polpak: what kind of different predicate?
polpakone that has a state
actually that still wouldn't work well
probably best to do your own iterator
deltabjust use a for loop and if
Borg7deltab: yeah i guess i'm going to have to revert back to that
or write '@data\n' separately
ironfroggypolpak: hey maybe ill create a go board in Second Life.
Dtu3ZOhtlnironfroggy, you play second life?
i tried it for about 10 minutes once. couldn't get into it
Borg7do beer and coding usually go well together?
jsoftwBorg7: yep, untill you go past a limit and get distracted and want to play games or look at random things on the interweb or such like.
Borg7haha
jsoftwThen there is a limit beyond that where you cant even read properly and shit
ironfroggyanyone know when ConfigParser became part of the std lib?
ferringba cold day in hell?
ironfroggy: sec, pulling it's history.
ivan`pep 3108 is horrible
ironfroggyivan`: more detail is nice. why?
bytecolorlooks like ConfigParser has been there a while
ivan`there's no reason to change something so trivial to a naming standard that is worse but more consistent
StringIO makes sense. stringio doesn't.
ironfroggyi think standardizing the modules on lowercase is a decent idea.

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

IrcArchive

NY Lost Funds