gpt4 book ai didi

python - 这个程序会损坏我的显示器吗?

转载 作者:太空宇宙 更新时间:2023-11-04 01:42:38 26 4
gpt4 key购买 nike

<分区>

我制作了一个 Python 程序,可以非常快速地在随机颜色之间来回切换整个显示器。我想知道它是否会以某种方式损坏我的显示器。

另外一个不相关的注意事项是,长时间在程序中上楼梯是有风险的。

程序

import Tkinter
import random

class AppTk(Tkinter.Tk):

def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.state("zoomed")
self.wm_attributes("-topmost", 1)
self.attributes('-toolwindow', True)
self.configure(bg='black')
self.switch()

def switch(self):
#self.BW()
#self.BG()
#self.C()
self.TC()


self.after(10, self.switch)

def BW(self):

U = random.randint(1,2)

if U == 1:
self.configure(bg='black')

if U == 2:
self.configure(bg='white')

def BG(self):

U = random.randint(1,2)

if U == 1:
self.configure(bg='black')

if U == 2:
self.configure(bg='lightgreen')

def C(self):

U = random.randint(1,14)

if U == 1:
self.configure(bg='black')

if U == 2:
self.configure(bg='white')

if U == 3:
self.configure(bg='pink')

if U == 4:
self.configure(bg='darkred')

if U == 5:
self.configure(bg='red')

if U == 6:
self.configure(bg='orange')

if U == 7:
self.configure(bg='yellow')

if U == 8:
self.configure(bg='green')

if U == 9:
self.configure(bg='lightgreen')

if U == 10:
self.configure(bg='darkgreen')

if U == 11:
self.configure(bg='lightblue')

if U == 12:
self.configure(bg='blue')

if U == 13:
self.configure(bg='darkblue')

if U == 14:
self.configure(bg='steelblue1')

def TC(self):
R = random.randint(1,255)
G = random.randint(1,255)
B = random.randint(1,255)
T = (R,G,B)
Colour = '#%02x%02x%02x' % T
self.configure(bg=Colour)



if __name__ == "__main__":
app = AppTk(None)
app.mainloop()

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com