android 7 sl4a,SL4A蟒蛇作出android手机

import android

droid = android.Android()

droid.makeToast(u"ascc4r")

运行此代码时,我得到以下错误:

pydev debugger: starting

Traceback (most recent call last):

File "C:\Users\Tibi\Desktop\adt-bundle-windows-x86_64-20130917\eclipse\plugins \org.python.pydev_2.8.2.2013090511\pysrc\pydevd.py", line 1446, in

debugger.run(setup['file'], None, None)

File "C:\Users\Tibi\Desktop\adt-bundle-windows-x86_64-20130917\eclipse\plugins org.python.pydev_2.8.2.2013090511\pysrc\pydevd.py", line 1092, in run

pydev_imports.execfile(file, globals, locals) #execute the script

File "C:\Users\Tibi\workspace\26\src\26module.py", line 7, in

droid = android.Android()

File "C:\Python26\lib\android.py", line 34, in __init__

self.conn = socket.create_connection(addr)

File "C:\Python26\lib\socket.py", line 547, in create_connection

for res in getaddrinfo(host, port, 0, SOCK_STREAM):

socket.gaierror: [Errno 11001] getaddrinfo failed

环境设置: - Python 2.6.6 - set ap_port = 9999 - adb forward tcp:9999 tcp:xxxx(xxxx,我在电话上启动服务器) 我的android.py位于Python/Lib文件夹中。

更新: 我尝试了CMD中的这3个指令,它的工作,使吐司。所以我认为这个错误出现在ADT包或Eclipse Python插件中。

什么是Errno 11001?

+0

尝试使用SL4A模块代替(进口SL4A) 。 –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值