I'm trying to make a program that kill all process apart itself

Viewed 43

i want to display one single screen avoiding the user to change desktop so i thought this could work but if i put os.system before all it kills everything and doesn't show the window, if i put it down it doesn't kill anything

from tkinter import *
from tkinter import ttk
import os
root = Tk()
def disable_event():
    pass
frm = ttk.Frame(root, padding=10)
frm.grid()
ttk.Label(frm, text="Hello World!").grid(column=0, row=0)
root.attributes('-fullscreen', True)
root.protocol("WM_DELETE_WINDOW", disable_event)
root.mainloop()
os.system("ps aux | grep -v 'python' | awk '{if (NR != 1) print $2}' |xargs kill")
0 Answers
Related