【发布时间】:2019-04-02 07:19:04
【问题描述】:
如何让每 10 秒自动改变程序背景 并且颜色会随机选择
color = (random.randint(0,255),random.randint(0,255),random.randint(0,255))
更新:
我想在这段代码中使用:
app = wx.App()
window = wx.Frame(None, title = "test con", size=(800,300) )
window.SetMaxSize(wx.Size(800,300))
window.SetMinSize(wx.Size(800,300))
window.SetIcon(wx.Icon("eq.ico"))
window.SetBackgroundColour(color)
panel = wx.Panel(window, wx.ID_ANY)
suka = bat()
def on_timer():
label1aa.SetLabel(str(ram_uz()))
label8.SetLabel(doi)
label16.SetLabel(str(random.randint(1,100)))
label1a.SetLabel(str(bat()))
wx.CallLater(1000, on_timer)
panel.SetBackgroundColour(color)
panel.SetCursor(wx.Cursor(wx.CURSOR_HAND))
【问题讨论】:
-
module 'threading' has no attribute 'thread'但它确实有一个Thread属性!注意大写T
标签: python-3.x wxpython