目录
Python库之网络爬虫
Python库之Web信息提取
Python库之Web网站开发
Python库之网络应用开发
Requests
import requests
r = requests.get("http://www.baidu.com");
r.status_code;
r.headers["content-type"];
r.encoding;
r.text;
r.encoding="utf-8";
r.text;
Scrapy
pyspider
Beautiful Soup
Re
正则表达式解析和处理功能库
Python-Goose
Django
Pyramid
#10行左右的Hello World程序
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello World!')
if __name__ == '__main__':
with Configurator() as config:
config.add_route('hello', '/')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 6543, app)
server.serve_forever()
Flask
WeRoBot
#对微信每个消息返回一个Hello World
import werobot
robot = werobot.WeRoBot(token='tokenhere')
@robot.text
def hello_world():
return 'Hello World!'
robot.run()
aip
MyQR
本文仅为学习Python记录,资料来源于中国大学MOOC《Python语言设计》—嵩天