吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2420|回复: 17
收起左侧

[Python 转载] 【源码+打包】查看剪切板历史记录小工具

  [复制链接]
大白baymax 发表于 2023-7-15 09:55
需要安装clipboard库和tkinter库,命令如下:
pin install clipboard
pip install tkinter


话不多说上代码:
[Python] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import tkinter as tk
import tkinter.scrolledtext as scrolledtext
import tkinter.messagebox as messagebox
import clipboard
def get_clipboard_history():
    history = clipboard.paste()
    return history
def show_clipboard_history():
    history = get_clipboard_history()
    messagebox.showinfo("Clipboard History", history)
def clear_clipboard():
    clipboard.copy('')
    messagebox.showinfo("Clipboard Cleared", "清理完毕.")
 # 创建主窗口
window = tk.Tk()
window.title("查看剪切板历史记录     by:大白baymax")
window.geometry("500x500")
 # 创建文本框
text_area = scrolledtext.ScrolledText(window, wrap=tk.WORD)
text_area.pack(expand=True, fill='both')
 # 创建按钮
btn_show_history = tk.Button(window, text="显示记录", command=show_clipboard_history)
btn_show_history.pack(pady=10)
btn_clear_clipboard = tk.Button(window, text="清除记录", command=clear_clipboard)
btn_clear_clipboard.pack(pady=10)
 # 运行主循环
window.mainloop()




上个主程序的图吧:

52pojie.jpg


最后是打包成EXE的文件:
链接:https://pan.baidu.com/s/1elL09iRYwy6kuZ25xWCTgA
提取码:oms3

免费评分

参与人数 6吾爱币 +6 热心值 +5 收起 理由
yanglinman + 1 谢谢@Thanks!
wanfon + 1 + 1 热心回复!
bangefanshi + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
wazt + 2 谢谢@Thanks!
愉悦少年 + 1 + 1 用心讨论,共获提升!
afo2023 + 1 + 1 用心讨论,共获提升!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

hrpzcf 发表于 2023-7-15 11:10
WIN + V,win10 win11 系统自带功能
屏幕截图 2023-07-15 110843.png

免费评分

参与人数 2吾爱币 +2 热心值 +2 收起 理由
时光书窝 + 1 + 1 自带的好用但是有条数限制
JcZhang + 1 + 1 Win+V很好用.

查看全部评分

TheSSS 发表于 2023-7-22 17:39
1.不是pin install clipboard,是pipinstall clipboard
PS F:\demo> pin install clipboard
无法将“pin”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后重试。
所在位置 行:1 字符: 4
+ pin <<<<  install clipboard
    + CategoryInfo          : ObjectNotFound: (pin:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
2.出现下面错误,参考一下https://blog.csdn.net/lohath/article/details/125001954
PS F:\demo> pip install tkinter
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
3.我也是小白一个,相互学习吧
Rray 发表于 2023-7-15 10:50
鹿鸣 发表于 2023-7-15 10:57
很实用,感谢分享
x1056795985 发表于 2023-7-15 10:59
微徽+v键 相同功能
afo2023 发表于 2023-7-15 11:06
多谢  很有帮助
aonima 发表于 2023-7-15 11:07
这个挺实用的,感谢分享
想你当年荷风微 发表于 2023-7-15 11:16
WIN + V,win10 win11 系统自带功能
bigdawn 发表于 2023-7-15 11:57
挺实用的,感谢分享!!
xianbin6730 发表于 2023-7-15 12:32
厉害啊 学习了 谢谢分享
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-7-10 13:49

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表