GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — pythontools/Mclips.py at master · frone/pythontools Expand file tree/ Copy pathMclips.pyMore file actions 33 lines (31 loc) · 1.83 KB / Copy pathMclips.pyFile metadata and controls33 lines (31 loc) · 1.83 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 import pyperclip import time # 本文件可以运行在Python环境下(需要先安装pyperclip),用于在依次复制图片URL和标题后生成Markdown格式的文本到剪切板 # 用于记录剪切板上的原内容(最新的内容) last_string = pyperclip.paste() # 生成Makdown图片格式的临时字符串,用于保存剪切板上的有效内容 temp_string = "" # 记录剪切板改变次数 i = 0 while True: # 检测频率 time.sleep(0.2) # 每循环一次获得剪切板上的内容 string = pyperclip.paste() # 如果剪切板上的内容发生了变化(与剪切板上的原内容不一致) if string != last_string and string != '': i=i+1 if i ==1: # 保存复制的第一个新字符串并加上Markdown部分内容 temp_string = "<div align=center><img src=\""+ string + "\" alt=\"" if i == 2: # 保存复制的第二个新字符串并加上Markdown剩余部分内容 temp_string = temp_string + string + "\" style=\"zoom: 80%;\" /></div>" # 将剪切板设置为temp_string并将 string 设置为最新内容 pyperclip.copy(temp_string) string = pyperclip.paste() print(string) # 完成两次复制以后回到重新开始记录 i = 0 # 每一次剪切板有变化都将last_string设置成剪切板上的新内容 last_string = string |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |