views:

168

answers:

3

I made a Python program that switches the entire monitor back and forth between random colours very quickly. I'm wondering if it can harm my monitor somehow.

Also on an unrelated note, it's tripy to stair at the program for extended periods of time.

The program

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()
+1  A: 

I wouldn't say it would damage your monitor since there are programs that do this in an attempt to fix dead pixels. I can't remember any off the top of my head since I haven't used one in 3 years.

So it shouldn't do much, but then again you wouldn't be running this for extended periods of time, would you?

vlad003
+1  A: 

No worry, you're not working at low enough levels to damage any of your hardware (on any semi-sane operating system, at least -- but I don't know any that's crazy enough to let application SW working at such a reasonable abstraction level to damage a monitor;-).

Alex Martelli
+1  A: 

A long time ago it was possible to damage CRT screens by using to large refresh frequencies (so the coils got overheated).

However since many years this is impossible, because the CRT have built-in electronics to detect the frequencies and show "unsupported mode" then.

Changing the color fastly is really no problem: It was never (the vertical refresh rate is always the same, even if you do not update a pixel) and it not a problem on flat panels.

IanH