简体   繁体   English

如何使用Android Pie在手臂板上运行python脚本?

[英]How to run python script on arm board with android pie?

I have python script and arm board with android pie. 我有python脚本和带有android pie的手臂板。 I have UART console and adb shell of board. 我有UART控制台和主板的adb shell。 Now i want to run python script on board ? 现在我想在板上运行python脚本吗?

How to add python packages in android build ? 如何在android build中添加python包?

  1. To run python, we need to install QPython apk on the board, which has the necessary python binaries to run python, Download the QPython apk 要运行python,我们需要在板上安装QPython apk,该板上具有运行python所需的python二进制文件,下载QPython apk
  2. Start the adb service on the board and connect to the host PC. 在板上启动adb服务并连接到主机PC。
  3. Install the qpython apk using the command: adb install 使用以下命令安装qpython apk:adb install
  4. After the apk is successfully installed, verify the installation by checking the org.qpython.qpy directory on the board. 成功安装apk后,通过检查开发板上的org.qpython.qpy目录来验证安装。 the directory contains python binaries. 该目录包含python二进制文件。
  5. Before running python, we need to source the init.sh script in the bin/ directory: source init.sh 在运行python之前,我们需要在bin /目录中获取init.sh脚本:source init.sh
  6. You can now run python by the following command from the bin/directory as: python-android5 /path/to/python/file.py 现在,您可以通过以下命令从bin /目录运行python:python-android5 /path/to/python/file.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM