eval() woes

Gabriel Genellina gagsl-py at yahoo.com.ar
Tue Aug 29 00:58:02 EDT 2006


At Tuesday 29/8/2006 01:13, rdrink wrote:

>   File "the_farmer2.py", line 112, in equate
>     iL = int(parts[1])
>ValueError: invalid literal for int(): -

So parts[1] is '-'.
Try adding a few print statements; I'd add a try/except around those 
lines, printing parts, I bet it's not what you expect it to be.
The problem appears to be in the calling code, not on this function.

>equate() was called 500 times... in some cases with the list 'parts'
>equaling things like ['0',2','3','0'], so I have no reason to believe
>that the problem is with the way the list is being passed in... but I
>could be wrong)

...like above, where you missed a quote.

>  Can anyone see something I can't?

Not on the code fragment you posted.


Gabriel Genellina
Softlab SRL 


	
	
		
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas




More information about the Python-list mailing list