发布时间:2019-09-26 09:10:00编辑:auto阅读(3478)
代码如下:
# -*- coding: utf-8 -*- import win32clipboard as wc import win32con def getCopyText(): wc.OpenClipboard() copy_text = wc.GetClipboardData(win32con.CF_TEXT) wc.CloseClipboard() return copy_text # test import chardet print chardet.detect(getCopyText()) # 找到包含中文内容的字符串编码 print getCopyText().decode('GB2312') # 转码
上一篇: python读取中文txt文本
下一篇: Python 基本语句
54980
41780
36363
31782
26686
26375
24900
20507
16451
15866
3005°
2731°
2822°
2976°
2911°
3176°
3063°
2905°
2901°
2882°