I'm a Python beginner and now it's freakin me out:
L = []
file = urllib.urlopen("http://someurl.com/someText.txt")
line = file.readline()
while line != "" :
L.append(line)
line = file.readline()
appuifw.selection_list(choices=L)
and I get this error:
line = file.readline()
^
SyntaxError: invalid syntax
Does anyone know what the issue is?
Seems to work fine in my Python interpreter (2.6.1).
I take it you did do
import urllib
first? (Not doing that would cause aNameError
, not aSyntaxError
.)EDIT: a quick Google found this: http://discussion.forum.nokia.com/forum/showthread.php?t=150563
It’s 18 months old, but it claims that PyS60 is Python 2.2.2. I don’t have that on my machine, but it might be worth seeing if that’s the issue.