import win32clipboard as w
import win32con
def get_text():
w.OpenClipboard()
d = w.GetClipboardData(win32con.CF_TEXT)
w.CloseClipboard()
return d.decode('GBK')
def set_text(aString):
w.OpenClipboard()
w.EmptyClipboard()
w.SetClipboardData(win32con.CF_TEXT, aString)
w.CloseClipboard()
#set_text('set_text')
# 读取剪切板内容
ss = get_text()
print(ss)