Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
注意:所有这些都是在运行 Android 2.2 的 Samsung Galaxy S 上进行测试的。 YMMV。
在我看到这个之前,我从来没有想过在 Android 上运行 Python。谢谢:)
我安装了 SL4A 应用程序并尝试了一个简单的 Shell 脚本。我正在安装 Python 解释器,并将很快尝试 hello world。
步骤很简单:
1. 下载应用程序(市场上没有该应用程序,因此请从 http://code 获取.google.com/p/android-scripting/)
2. 单击“添加”按钮并在弹出的选项中选择“Shell”来创建 shell 脚本
3. 编写代码。
4. 选择“保存并运行”(或“保存并退出”并单击主窗口中的脚本名称)
5. 此时,您的脚本的输出应该显示在终端窗口中。
现在我正在尝试安装 Python 解释器。将保持线程更新,但我想这将是同一组步骤。我在下载文件时遇到很多问题 - 下载速度很慢并且不断关闭。
我不知道你是否可以从 Android 应用程序调用这些脚本。该项目的意图似乎恰恰相反。但我知道什么!
编辑:继续我的 Python 经验。
1. 打开 SL4A 并进入“查看”->“解释器”菜单。如果 Python 未列出,则从菜单中选择“添加”。
2.这将下载您安装的apk(确保安装非市场应用程序可用)
3. 打开 Android 版 Python 应用程序。它有一个按钮“安装”
4. 单击“安装”并等待...然后等待...在此之前不要使用手机,安装似乎存在此应用程序中的错误,因此如果您在手机或标签上使用任何其他应用程序而不是此应用程序下载被取消!!!
5. 成功安装后返回 SL4A,您现在应该在解释器中看到 Python 以及许多示例 Python 脚本。
6. 示例似乎涵盖了相当多的 API。我所看到的给我留下了深刻的印象。
编辑:
自从最初的帖子发布以来,我还在运行 Android 4.0 的 Galaxy S2 上进行了测试。取得了同样令人印象深刻的结果。
Note: All this was tested on my Samsung Galaxy S running Android 2.2. YMMV.
I never thought of running Python on android till I saw this. Thanks :)
I installed the SL4A app and tried out a simple Shell script. I am installing the Python interpreter and will be trying out a hello world soon.
The step were straight forward:
1. Download the app (it.s not on the market so get it from http://code.google.com/p/android-scripting/)
2. Create a shell script by clicking the Add button and choosing Shell in the options that pop-up
3. Write your code.
4. Select "Save and Run" (or "Save and Exit" and click on the script name in the main window)
5. At this point your script's output should show up in the terminal window.
Now I am trying to install the Python interpreter. Will keep the thread updated but I guess this will be same set of steps. I am having a lot of issues downloading the files - the download is slow and keeps closing.
I don't know if you can call these scripts from an Android appln. The intention of the project seems to be the other way around. But what do I know!
Edit: Continuing with my experience with Python.
1. Open SL4A and go to View->Interpreters menu. If Python isn't listed then select Add from the menu.
2. This will download an apk which you install (make sure install non-market applications is available)
3. Open the Python for Android app. It has a single button "Install"
4. Click on the Install and wait... and wait... Don't use the phone till this the install is there seems to be bug in this app so if you use any other app on the phone or tab away from this one the download gets cancelled!!!
5. After a successful install return to SL4A you should now see Python in the Interpreters and a lot of sample Python scripts.
6. The samples seem to cover quite a bit of the APIs. I was quite impressed by what I saw.
Edit:
Since the original post I have also tested on a Galaxy S2 running Android 4.0. with similarly impressive results.
安装 Android Scripting (SL4A) .apk 后,您是否已安装 适用于 Android 的 Python?
After installing Android Scripting (SL4A) .apk have you installed Python for Android?