简体   繁体   English

Android获取从Python生成的结果

[英]Android get result generated from Python

Since I am a starter of Python, I just written some code for grab some text in a long string. 因为我是Python的入门者,所以我只写了一些代码来获取长字符串中的某些文本。
Normally, for the client-server communication, I use PHP as server side language. 通常,对于客户端-服务器通信,我使用PHP作为服务器端语言。
After Google Python, I know that in some ways, Python will run faster than PHP for example to get all link in a HTML. 在使用Google Python之后,我知道在某些方面,Python的运行速度将比PHP高,例如,获取HTML中的所有链接。
Using PHP, I know that I can using regular expression to extract all links in HTML and generate the results as JSON and get back to Android side using HTTP. 使用PHP,我知道我可以使用正则表达式提取HTML中的所有链接,并将结果生成为JSON,然后使用HTTP返回Android端。
The question is, how can I do it in Python way/? 问题是,我该如何用Python方式/?
I really had no experience with python in server. 我真的没有在服务器上使用python的经验。 Is it possible to do that? 有可能这样做吗?
If yes, please give some hint. 如果是,请给一些提示。

It's not difficult to scrub the links from a page as described in this old answer: 按照以下旧答案中所述从页面中清除链接并不难:

https://stackoverflow.com/a/13465097/514485 https://stackoverflow.com/a/13465097/514485

Python has a JSON module that makes it easy to format your results in JSON. Python有一个JSON模块,可轻松以JSON格式格式化结果。

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

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