Python Message Boxes

Publié le: 04 avril 2021
sur la chaîne: the Abdulcools
58
3

Subscribe and hit that like button

Code :
import tkinter as tk
import time
from tkinter import *
import datetime
from tkinter import messagebox

d = datetime.datetime.now()

localtime = time.localtime()
top = Tk()

top.geometry("400x400")

def jumbo():
messagebox.showinfo("Universal", localtime)

def date():
messagebox.showinfo("date and time", datetime.datetime.now() )

def month():
messagebox.showinfo("Month", d.strftime("%m") )

B1 = Button(top, text = "Universal", command = jumbo, bg = "#1684f2" , font = ("sansserif 10 bold"))
B1.place(x = 35,y = 50)

B2 = Button(top, text = "Date and Time", command = date, bg = "#1684f2" , font = ("sansserif 10 bold"))
B2.place(x = 135,y = 50)

B3 = Button(top, text = "Month", command = month, bg = "#1684f2" , font = ("sansserif 10 bold"))
B3.place(x = 275,y = 50)

top.mainloop()

Code 2:
from tkinter import *
from tkinter import messagebox

root = Tk()
root.geometry("300x200")

w = Label(root, text ='Message Box By Abdullah', font = "50")
w.pack()

messagebox.showinfo("showinfo", "Information")

messagebox.showwarning("showwarning", "Warning")

messagebox.showerror("showerror", "Error")

messagebox.askquestion("askquestion", "Are you sure?")

messagebox.askokcancel("askokcancel", "Want to continue?")

messagebox.askyesno("askyesno", "Find the value?")


messagebox.askretrycancel("askretrycancel", "Try again?")

root.mainloop()


Sur cette page du site, vous pouvez voir la vidéo en ligne Python Message Boxes durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur the Abdulcools 04 avril 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 58 fois et il a aimé 3 téléspectateurs. Bon visionnage!