Code: Select all
import sys
import os
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
# Create an instance of tkinter frame
win= Tk()
# Set the size of the tkinter window
win.geometry("700x350")
# Define a function to show the popup message
def show_msg():
os.system('mail.py')
messagebox.showinfo("Message","Email Sent Successfully.")
def gen_certificate():
os.system('certificate.py')
messagebox.showerror("error","continuwe")
messagebox.showinfo("Message","Certificate Generated Successfully.")
# Add an optional Label widget
Label(win, text= "Welcome to MBR Admin!", font= ('Aerial 17 bold italic')).pack(pady= 30)
# Create a Button to display the message
ttk.Button(win, text= "Send Mail", command=show_msg).pack(pady= 20)
ttk.Button(win, text= "Generate Certificate", command=gen_certificate).pack(pady= 20)
win.mainloop()