0
from random import randint
from tkinter import *
import time

screen = Tk()

widthOfScreen = screen.winfo_screenwidth() #Get the width of the screen
heightOfScreen = screen.winfo_screenheight() #Get the height of the screen

screen.geometry("%dx%d+0+0" % (widthOfScreen, heightOfScreen))

def spammer():
    count = 0
    for count in range(0,1000):
        Button(screen, text = count, font = ("Eras Light ITC", 14), foreground='black', activebackground = "white", activeforeground = "purple",borderwidth = 5, background = "white", height = 3, width = 5, command = spammer).place(x = randint(0,widthOfScreen), y = randint(0,heightOfScreen))
        time.sleep(0.01)
        screen.update()


spam = Button(screen, text = "Do not press", font = ("Eras Light ITC", 14), foreground='black', activebackground = "white", activeforeground = "purple",borderwidth = 5, background = "white", height = 3, width = len("do not press   "), command = spammer).place(x = (widthOfScreen/7), y = (8*(heightOfScreen/12)))


screen.mainloop()
2
Contributors
2
Replies
25
Views
3 Years
Discussion Span
Last Post by CodingCabbage
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.