TA的每日心情 | 擦汗 10 小时前 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
问题:
monkeyrunner Python 中怎么导入 viewclient
测试时想用ViewClient,于是下了jar包,解压,添加环境变量,只写了一个导入语句的py 文件,
from com.dtmilano.android import viewclient
在Python环境下直接运行from com.dtmilano.android import viewclient,没有错误
- <div><font face="微软雅黑" size="3">C:\Users\Administrator>python</font></div><div><font face="微软雅黑" size="3">Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win</font></div><div><font face="微软雅黑" size="3">32</font></div><div><font face="微软雅黑" size="3">Type "help", "copyright", "credits" or "license" for more information.</font></div><div><font face="微软雅黑" size="3">
- </font></div><div><font face="微软雅黑" size="3">from com.dtmilano.android import viewclient</font></div>
复制代码
但是用monkeyrunner 运行py文件,会出错
- <div><font face="微软雅黑" size="3">C:\Users\Administrator>monkeyrunner D:\work\workspace\aaa\test.py</font></div><div><font face="微软雅黑" size="3">140120 17:04:28.586:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] Scri</font></div><div><font face="微软雅黑" size="3">pt terminated due to an exception</font></div><div><font face="微软雅黑" size="3">140120 17:04:28.586:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]Trace</font></div><div><font face="微软雅黑" size="3">back (most recent call last):</font></div><div><font face="微软雅黑" size="3">File "D:\work\workspace\aaa\test.py", line 27, in </font></div><div><font face="微软雅黑" size="3">from com.dtmilano.android import viewclient</font></div><div><font face="微软雅黑" size="3">ImportError: No module named dtmilano</font></div>
复制代码
问什么呢?导包的话该怎么写呢?菜鸟求指教。谢谢。
|
|