读取txt文档

来源:互联网 发布:正规的网络博客 编辑:程序博客网 时间:2024/04/28 02:30

readtxt.py读取文档

# -*- coding: utf-8 -*-#读取txt文档from urllib.request import urlopen#请求url并把结果用utf-8编码html = urlopen("https://en.wikipedia.org/robots.txt")print(html.read().decode("utf-8"))
0 0
原创粉丝点击