tags:

views:

37

answers:

1

Hello,

Im running the following code on my Nokia E71. But after the 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

+2  A: 

Hi,

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.

brsata