DemoRepo / demo.py
Language's picture
Initial
75487c0
# from tkinter import *
# root = Tk()
# root.geometry("500x500+0+0")
# frmMain = Frame(root,bg="blue")
#
# startbutton = Button(frmMain, text="Start",height=1,width=4)
# startbutton.grid()
#
# #Configure the row/col of our frame and root window to be resizable and fill all available space
# frmMain.grid(row=0, column=0, sticky="NESW")
# frmMain.grid_rowconfigure(0, weight=1)
# frmMain.grid_columnconfigure(0, weight=1)
# root.grid_rowconfigure(0, weight=1)
# root.grid_columnconfigure(0, weight=1)
#
# root.mainloop()
# import speech_recognition as sr
# r = sr.Recognizer()
# with sr.Microphone() as source:
# print("Speak Anything")
# audio = r.listen(source,phrase_time_limit=5)
# try:
# text = r.recognize_google(audio)
# print("You said : {}".format(text))
# except:
# print("Sorry could not recognize what you said")
#Import tkinter library
from tkinter import *
#Create an instance of Tkinter frame or window
win= Tk()
#Set the geometry of tkinter frame
win.geometry("750x250")
#Make the window sticky for every case
win.grid_rowconfigure(0, weight=1)
win.grid_columnconfigure(0, weight=1)
#Create a Label
label=Label(win, text="This is a Centered Text",font=('Aerial 15 bold'))
label.grid(row=2, column=0)
label.grid_rowconfigure(1, weight=1)
label.grid_columnconfigure(1, weight=1)
win.mainloop()