Error in python script
Oleg Broytmann
phd at emerald.netskate.ru
Wed Jul 7 06:17:55 EDT 1999
On Wed, 7 Jul 1999, John wrote:
> Traceback (innermost last):
> File "C:\InetPub\scripts\ffratingextract.py", line 39, in ?
> field_name, field_value = string.split(line, ':')
> ValueError: unpack list of wrong size
The problem is that you expected 2-tuple (field_name, field_value), but
strin.split returns 1 (there is no ':' in line) or >3 (there are few colonss).
Try this:
field_name, field_value = string.split(line, ':', 1)
Oleg.
----
Oleg Broytmann Netskate/Inter.Net.Ru phd at emerald.netskate.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list