I have some code that creates a lock screen using python that deletes the task bar and stops them leaving. However when they get the password right it does not make the task bar come back. The command works in cmd but it does not work in python.
Here is the code:
import os
from tkinter import*
import time
run = input("Do you want to lock your computer? ")
if run == "yes":
a=Tk()
a.overridedirect(1)
w, h = a.winfo_screenwidth(), a.winfo_screenheight()
a.geometry("%dx%d+0+0" % (w, h))
os.system('taskkill /f /im explorer.exe')
a.attributes("-topmost", True)
L1 = Label(a, text="Please enter the password to continue: ")
L1.pack( side =TOP)
Ebox = Entry(a, bd =5)
Ebox.pack(side =TOP)
Ebox.config(show="*");
def check():
if Ebox.get() == "password":
time.sleep(0.3)
os.system('powershell -command "Invoke-item c:\windows/explorer.exe"') # This line does not execute the command
a.destroy()
b = Button(a, text="submit", command=check )
b.pack(side=TOP)
a.mainloop()