简体   繁体   English

如何在Android中使用lxml?

[英]How do i use lxml in Android?

Python for Android supports lxml. 适用于Android的Python支持lxml。 But how can I import it? 但是如何导入呢? On the google site, there is a modul in a recipe.sh file. 在Google网站上,recipe.sh文件中有一个模块。 But i can not run it through the shell there. 但是我不能通过那里的外壳运行它。 I get some errors: 我收到一些错误:

app_122@android:/mnt/sdcard $ sh recipe.sh
: nor found]
recipe.sh[6]: get_directory: not found
: not found]
recipe.sh[9]: syntax error: '{^M' expected
1 app_122@android:/mnt/sdcard

Can't I just get some .py file and simply import it into my programms? 我不能只获取一些.py文件并将其简单地导入到我的程序中吗?

I used this code: https://github.com/kivy/python-for-android/blob/master/recipes/lxml/recipe.sh 我使用了以下代码: https : //github.com/kivy/python-for-android/blob/master/recipes/lxml/recipe.sh

Can someone help? 有人可以帮忙吗?

I think you might be confusing py4a which is a sister project of SL4A (Scripting Layer For Android) with https://github.com/kivy/python-for-android which is a sister project of Kivy 我认为您可能会将py4a(这是SL4A (Android脚本层)的姊妹项目)与https://github.com/kivy/python-for-android(这是Kivy的姊妹项目) 混淆了

Both are different projects with different targets. 两者都是具有不同目标的不同项目。 You should be clear about which project you want to use. 您应该清楚要使用哪个项目。 Read the docs to get more familiar. 阅读文档以更熟悉。

kivy/python-for-android docs kivy / python-for-android 文档

Discussion groups 讨论小组

py4a docs py4a 文档

Discussion groups 讨论组

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

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