#python - Sat 21 Apr 2007 between 16:55 and 17:09

NY Lost Funds



Markonironfroggy: can you see here http://forum.ubuntu-it.org/index.php?topic=78865.0 ?
ironfroggyx%2 is true if x is odd
Markon(i'm italian, sorry :( )
ironfroggyMarkon: which is even and odd? i dont speak italian.
im guessing pari is even?
as in "pair"
yes?
Markonironfroggy: yeah ;)
ironfroggysimplify it.
if x%2: print "odd"
else: print "even"
basically
plastic_wrapironfroggy: queues... good idea. i think i need to refactor this code.
Markonuhm, my problem is " None"
ironfroggy: my problem is
ironfroggybecause you are printing the return value of the Confronta() function, which has no explicit return
so it returns None
Markonahhh ok ok , thanks ;)
ironfroggyyou can either just call it, without the print statement. or instead of the two print statements inside it, you can have it return the message and then print that.
i suggest the second.
Markonthank you :D
ironfroggyalso i suggest against the use of the input function
and would encourage you use int(raw_input()) instead
Markonuhm... ok :D
thank you
ironfroggyinput() actually evaluates anything the user enters as python code
so it can be dangerous
it was a really dumb idea, basically.
hopefully it gets pulled
Markonso I will use "return" and "int(raw_input())" ok
eugmanSince a file is an iterable does that mean it can be slices?
er sliced
Markonbye ;)
ironfroggyno
iteration does not imply slicing
eugmanOk so if I want a list of the lines from line x to line y what's the best way to do that?
VegarIs there a way to get the output of PyErr_Print() in a variable, or rather, a way to get a string containing what PyErr_Print() prints?
ironfroggyeugman: islice
from the itertools module
samu2Can't you do file.readlines()[fromline:toline] ?

Page: 1 8 15 22 29 36 43 50 57 64 

IrcArchive

NY Lost Funds