I am trying to set date and time on my window 1. I don't know how to do that. Can anyone please help me.
What I have tried:
from tkinter import *
import tkinter as tk
from tkinter import messagebox
import serial
class Win1(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
self.controller = controller
Label(self, text= "ISMC", font= ('Helvetica 20 bold')).pack(padx=300, pady=5)
B1=Button(self, text="AUTO", command=lambda:controller.show_frame(Win2)).pack(pady=20, padx=200)
B2=Button(self, text="MANUAL", command=lambda:controller.show_frame(Win4)).pack(pady=20, padx=200)
class Win2(tk.Frame):
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent)
class Application(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
window = tk.Frame(self)
window.pack(side = "top", fill = "both", expand = True)
self.frames = {}
for F in (Win1, Win2):
frame = F(window, self)
self.frames[F] = frame
frame.grid(row = 0, column=0, sticky="nsew")
self.show_frame(Win1)
def show_frame(self, window):
frame = self.frames[window]
frame.tkraise()
self.title("Relay Test")
self.geometry('1500x1500')
app = Application()
app.mainloop()