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()

Recommended Answers

All 2 Replies

Ehm, what was your purpose by posting this? Do you want help as to how to improve it or what?

Was just for people to look at as a bit of fun... sorry???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.