V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  EngAPI  ›  全部回复第 25 页 / 共 39 页
回复总数  778
1 ... 21  22  23  24  25  26  27  28  29  30 ... 39  
2023 年 12 月 31 日
回复了 sungo 创建的主题 Python Python tkinter 如何实现自动滚动的文本框
import tkinter as tk
from tkinter import messagebox
import threading
import queue
import time

def down():
for i in range(1, 100):
output_queue.put(f"下载附件 {i}\n")
time.sleep(0.3)
return

def on_download_click():
try:
download_thread = threading.Thread(target=down, args=())
download_thread.start()
except Exception as e:
messagebox.showerror("错误", "该日期段没有附件下载")

def update_output_text():
while not output_queue.empty():
output_text.insert(tk.END, output_queue.get())

# 检查滚动条是否在底部
scroll_position = scrollbar.get()
if not fm_main.manually_scrolled or scroll_position[1] == 1.0:
output_text.see(tk.END)

fm_main.after(100, update_output_text)

def on_scroll(*args):
# 判断滚动条是否在底部
scroll_position = scrollbar.get()
if scroll_position[1] == 1.0:
fm_main.manually_scrolled = False
else:
fm_main.manually_scrolled = True

if __name__ == '__main__':
fm_main = tk.Tk()
fm_main.title("邮件附件批量下载_v1.0")
fm_main.geometry('600x300')
fm_main.resizable(0, 0)

btn1 = tk.Button(fm_main, text="下载", font=("Arial", 13), width=25, height=2, command=on_download_click)
btn1.pack()

scrollbar = tk.Scrollbar(fm_main)
scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

output_text = tk.Text(fm_main, font=("Arial", 12), width=60, height=10)
output_text.pack(side=tk.LEFT, fill=tk.BOTH)

output_text.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=output_text.yview)

output_queue = queue.Queue()
fm_main.after(100, update_output_text)

output_text.bind("<MouseWheel>", on_scroll)
output_text.bind("<Button-4>", on_scroll)
output_text.bind("<Button-5>", on_scroll)

fm_main.manually_scrolled = False

fm_main.mainloop()

问的 chatgpt3.5 的,你看看能运行么?
2023 年 12 月 28 日
回复了 lgapple 创建的主题 耳机 耳机(舒适且音质不渣),求推荐
我对音质好像也没啥需求,但是感觉 TWS 不如有线的音质好。
oppo enco x ,每天听小说用,觉得挺好的。
挺坏了的话准备买个 oppo enco x2
2023 年 12 月 28 日
回复了 YukiHanaNo 创建的主题 汽车 统计一下各位车主开过几年车,跑过多少万公里
试驾是免费的,还有零食吃,有时候还给礼品。
2023 年 12 月 28 日
回复了 zzlit 创建的主题 问与答 求推荐墨水屏阅读器
如果看英文的,首推 kindle ,你都能上这里了,导入很简单,calibre 转下 mobi 格式。
看中文的海信那个看起来小小的不错。
2023 年 12 月 19 日
回复了 pplive 创建的主题 宽带症候群 为了防止家里公网 IP 被乱扫,我做了个黑名单 IP 表
@fankangsong istoreos 默认开了如下端口
22 ,2049 ,53 ,32778 ,32777 ,111 ,32780
2023 年 12 月 19 日
回复了 liuhy0927 创建的主题 游戏 有没有不吃电脑配置的游戏?
星际争霸 1 ,我时不时拿出我的 x220 玩一局
2023 年 12 月 18 日
回复了 kokerkov 创建的主题 问与答 想弄一个海外服务器的 blog,询问一下主机问题
免费薅来的 oracle 近 800 天在线,我觉得他们的服务稳定性不错。
建议你买个收费的 oracle 服务器
2023 年 12 月 17 日
回复了 lifi 创建的主题 Python 买了本 Python 书籍入门
加油,有其他语言的基础学这个很容易,我几乎没看书,都是搜索看语法怎么用,用实际应用入门后再细细琢磨。
2023 年 12 月 16 日
回复了 albin504 创建的主题 程序员 准备在腾讯云开发者社区写技术博客了
cnblog 不考虑一下吗?
2023 年 12 月 12 日
回复了 cmos 创建的主题 旅行 泰国苏梅岛一周考察:热钱、落后和待发展
我还以为这岛很发达来着,当年嫌这里人多去了象岛,也差不多样子,怎么感觉比象岛人还少?
2023 年 12 月 12 日
回复了 shenqi 创建的主题 健康 分享下胃镜肠镜和割息肉
请问贵庚?
2023 年 12 月 12 日
回复了 sandylaw 创建的主题 小米 红米 K70 在无法解锁的情况下,如何删除某些功能软件?
@s642153378 好奇你装了啥,我用了 note12turbo 几周也没电话进来,clash meata,telegram,x,youtuber,币安,chatgpt 都装了
2023 年 12 月 11 日
回复了 mylastfire 创建的主题 问与答 你有没有一直在坚持做的事情呢?
背单词
百词斩背了 1000 天觉得太不自由了
换了 anki ,kindle 看了 3 年英文书同时把生词导出后背了 3 年
看英文书和背单词成了每天必修课,应该会一直持续下去吧。
2023 年 12 月 10 日
回复了 gitrebase 创建的主题 Android 2023 年有什么安卓手机原生就支持 Google 框架的吗
最近买了台红米 note12turbo ,可以
前面的 note8pro 也可以
小米本身就可以
推论是小米和红米的手机都可以
1 ... 21  22  23  24  25  26  27  28  29  30 ... 39  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1003 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 2017ms · UTC 22:20 · PVG 06:20 · LAX 15:20 · JFK 18:20
♥ Do have faith in what you're doing.