label and explain the components of python window
Answers
Answer:
To display one or more lines of text in a label widget, set this option to a string containing the text. Internal newlines ("\n") will force a line break. To slave the text displayed in a label widget to a control variable of class StringVar, set this option to that variable.
Answer:
from tkinter import *
top = Tk()
top.geometry("450x300")
# the label for user_name
user_name = Label(top,
text = "Username").place(x = 40,
y = 60)
# the label for user_password
user_password = Label(top,
text = "Password").place(x = 40,
y = 100)
submit_button = Button(top,
text = "Submit").place(x = 40,
y = 130)
user_name_input_area = Entry(top,
width = 30).place(x = 110,
y = 60)
user_password_entry_area = Entry(top,
width = 30).place(x = 110,
y = 100)
top.mainloop()