【发布时间】:2012-02-21 05:59:25
【问题描述】:
我在将一个看似存在的模块:simplejson 导入到我的 MonkeyRunner 脚本中时遇到了一些困难。
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
import simplejson
def main():
print "this is a test"
if __name__ == "__main__":
main()
ImportError: 没有名为 simplejson 的模块
据我了解,MonkeyRunner 使用基于 Python 2.5 的 Jython 2.5?。我知道 JSON 模块来自 Python 2.7,但我已经在“/Library/Python/2.5/site-packages/simplejson-2.3.2-py2.5-macosx-10.7-x86_64.egg”下安装了 Python 2.5 的 simplejson
我的问题是,如何正确地将 simplejson 模块导入到 MonkeyRunner 脚本中?
【问题讨论】:
标签: android python jython monkeyrunner