在android终端模拟器中执行python脚本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18901323/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Executing python script in android terminal emulator
提问by user2796429
I installed python 2.7 in my Android device and I tried executing a python script by typing the command in terminal emulator. The problem is that although I use the full path for python the following error appears:
我在 Android 设备中安装了 python 2.7,并尝试通过在终端模拟器中键入命令来执行 python 脚本。问题是,虽然我使用 python 的完整路径,但出现以下错误:
link_image[1997]: failed to link ./python CANNOT LINK EXECUTABLE.
link_image[1997]: failed to link ./python CANNOT LINK EXECUTABLE.
I tried to add environment variables in ./~bashrc but I didn't make it. Any idea ?
我试图在 ./~bashrc 中添加环境变量,但我没有成功。任何的想法 ?
采纳答案by user2796429
OK it is solved. I followed these steps (http://code.google.com/p/python-for-android/wiki/RunPythonFromShell) but first I had to put the file standalone_python.sh in /data/ because in sdcard I had no permission to execute. And finally using 'su' I made it to run my script as root.
OK 解决了。我按照这些步骤(http://code.google.com/p/python-for-android/wiki/RunPythonFromShell)但首先我必须将文件 standalone_python.sh 放在 /data/ 因为在 sdcard 我没有权限执行。最后使用 'su' 我让它以 root 身份运行我的脚本。