开发者

Application closes on Nokia E71 when using urllib.urlopen

Im running the following code on my Nokia E71. But after t开发者_JAVA百科he text input, the program closes abruptly. I have a GPRS connection on my phone,but i still seem to be having some problem with urllib.urlopen

The code is as follows :

import appuifw,urllib

amountInDollars = appuifw.query(u"Enter amount in Dollars","text") data=urllib.urlopen("http://www.google.com").read()
appuifw.note(u"Hey","info")

Any way to fix this problem ? Thank You


Rewriting to:

import appuifw,urllib

amountInDollars = appuifw.query(u"Enter amount in Dollars","text") 
f=urllib.urlopen("http://www.google.com")
data=f.read()
f.close()
appuifw.note(u"Hey","info")

it should work now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜