开发者

Application closes on Nokia E71 when using urllib.urlopen

开发者 https://www.devze.com 2023-01-01 01:11 出处:网络
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 wit

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

精彩评论

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