【发布时间】:2019-04-02 15:24:13
【问题描述】:
好吧,我几天前就遇到了问题,有人帮我踩踏,但我的代码真的很丑(我对编码完全陌生)现在我试图以更聪明的方式让它变得更好,但现在我的 gui 一直都在发抖. 我试着像我上一个代码那样做,但这次它不起作用。 这次我该怎么办我无法理解但想理解它。 一些有用的提示和技巧? 还是更智能、更快、更强大的更好方法,或者 mybae the gui more Beautyfule?
import time
import sys
from tkinter import *
import threading
root = Tk()
root.geometry("600x400")
global start
start = 1
def startUp():
user_input()
thr = threading.Thread(target=user_input)
thr.start()
def user_input():
global nameInput
global start
nameInput = textBox.get("1.0","end-1c")
start = 0
if start < 1:
while True:
apex = ApexLegends("APIKey")
player = apex.player(nameInput)
print("Gesamt Kills: " + player.kills + "\n" + 'Gesamt Damage: ' + player.damage)
time.sleep(3)
else:
print("stop")
anleitung=Label(text="Gib einen Spielernamen ein und drücke Start")
anleitung.pack()
textBox=Text(root, height=1, width=30)
textBox.pack()
startButton=Button(root, height=1, width=10, text="Start", command=lambda:startUp())
startButton.pack()
【问题讨论】:
-
什么是
ApexLegends?它是一个类还是一个函数?当您执行apex = ApexLegends("APIKey")时,是否需要很长时间(其中“long”表示“大于 300 毫秒左右)? -
它是对一个库的访问,旨在更轻松地使用 Game Apex Legends 的 api
-
我还是不知道那是什么意思。它是类还是函数调用?它是快还是慢?如果速度很快,就没有理由使用线程。
-
我真的不知道看看这个会有助于找出它吗? prntscr.com/n6hjig
标签: python python-3.x tkinter