You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tkinter按钮无法控制挖矿循环启停的问题求助

Tkinter按钮无法控制挖矿循环启停的问题求助

大家好,我最近一直在折腾这个挖矿程序的按钮控制逻辑,但怎么都搞不定😭。我想做一个能启动/停止挖矿循环的按钮,结果现在要么程序关闭后挖矿才开始跑,要么按钮点了完全没反应。有没有大佬能帮我看看哪里出问题了?

我的代码如下:

import hashlib
import time
from tkinter import *
import tkinter as tk

i = 1
root = tk.Tk()
# root window title and dimension
root.title("Bitcoin miner")
# Set geometry (widthxheight)
root.geometry('200x100')

def toggle():
    if toggle_btn.config('relief')[-1] == 'sunken':
        toggle_bt

备注:内容来源于stack exchange,提问作者Nicole Szaroz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 17:14:38