I'm trying to shut down the computer when the yes button of messagebox is clicked, but my code doesn't work somehow, and I don't know where is the problem
import tkinter as tk
from tkinter import messagebox
import os
res = messagebox.askquestion("Prezentácia bez názvu.pptx", "Failed to load. Do you wish to continue? ")
def shutdown():
return os.system("shutdown /s /t 1")
def askMe():
if res == 'yes':
command=shutdown
if res == 'no':
command=shutdown