For example:- first the program should lock abc.exe file and the file should only be able to unlock or run when user enters the correct password for it.
This should happen using Python program, since this is just a submodule of a main program.
This program do locks the program but unlocking doesn't work. ''' import locket from tkinter import * from tkinter import ttk
win = Tk()
win.title('SELECT THE PROGRAM')
path = "C:\\users\\admin\\abc\\abc.exe"
lock = locket.lock_file(path)
try:
lock.acquire()
finally:
lock.release()
#locket._unlock_file()
def close_win():
win.destroy()
def disable_event():
pass
btn = ttk.Button(win, text="Click here to Close", command=close_win)
btn.pack()
win.protocol("WM_DELETE_WINDOW", disable_event)
# Create a fullscreen window
win.attributes('-fullscreen', True)
win.mainloop()
'''