- 1

What is wrong with this code

import random import randint import time import threading root = Tk() root.attributes("-alpha", 0) root.overrideredirect(1) root.attributes("-topmost", 1) def placewindows(): while True: win = Toplevel(root) win.geometry("300x60+" + str(randint(0, root.winfo_screenwidth() - 300)) + "+" + str(randint(0, root.winfo_screenheight() - 60))) win.overrideredirect(1) Label(win, text="You got hacked", fg="red").place(relx=.38, rely=.3) win.lift() win.attributes("-topmost", True) win.attributes("-topmost", False) root.lift() root.attributes("-topmost", True) root.attributes("-topmost", False) time.sleep(.05) threading.Thread(target=placewindows).start() root.mainloop()

8th Jul 2022, 9:49 PM
peter mburu
peter mburu - avatar
3 Answers
+ 2
Tag the language so we know what language this is writing in. Explain what the code is supposed to do. What is it for?
9th Jul 2022, 1:52 AM
Chris Coder
Chris Coder - avatar
+ 2
Also, it's better to add a link to your code in Code Playground instead of pasting the full code. In Code Playground, we can debug the code and test solutions. Pls edit your code changing that to make it easier to help you.
10th Jul 2022, 12:07 AM
Emerson Prado
Emerson Prado - avatar
+ 1
I'm guessing its Tkinter for python?
9th Jul 2022, 1:54 AM
Chris Coder
Chris Coder - avatar