使用 urllib.urlopen 时应用程序在诺基亚 E71 上关闭

发布于 2024-09-02 07:20:55 字数 319 浏览 2 评论 0原文

我在我的诺基亚 E71 上运行以下代码。但在输入文本后,程序突然关闭。我的手机上有 GPRS 连接,但我似乎仍然遇到 urllib.urlopen 的问题

代码如下:

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")

有什么办法解决这个问题吗? 谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

后来的我们 2024-09-09 07:20:55

重写为:

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")

现在应该可以工作了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文