python检测编码
2024-09-05 04:23:29
# -*- coding: utf-8 -*-
import chardet
import urllib #可根据需要,选择不同的数据
TestData = urllib.urlopen('http://www.baidu.com/').read()
try:
print chardet.detect(TestData)
except Exception,e:
print(e)
运行的时候可能会出错,试着重新打开pycharm
最新文章
- css 温故而知新 定位(position)与权限(z-index)
- Java Web Cookie
- liunx几台机器直接用ssh链接
- JavaScript高级程序设计11.pdf
- BZOJ 1610: [Usaco2008 Feb]Line连线游戏
- 用Bottle开发web程序(二)
- 利用GeneratedKeyHolder获得新增数据主键值
- github使用及代码同步
- Python descriptor
- JAVA 语法2
- sourceTree回退撤销commit
- 安装VisualSVN Server 报";Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for more details";错误.原因是启动";VisualSVN Server";失败
- 非对称加密与GPG/PGP
- Hbase远程连接:Can't get the locations
- MAC LINUX 安装PYQT(事例)
- 4.keras实现-->;生成式深度学习之用GAN生成图像
- 微信公众号支付JSAPI,提示:2支付缺少参数:appId
- 微信小程序 --- action-sheet底部弹框
- 寻找最大的K个数(上)
- 【Oracle 12c】CUUG OCP认证071考试原题解析(35)