mytechtrail

Teaching myself Python Day 1


I have decided to start by following a tutorial to learn how to display data in a window and the add various code to get data to display. I am following: https://likegeeks.com/python-gui-examples-tkinter-tutorial/

Here is the display from today's code which I will post below the picture.
351665157-46a5d1062626599fd745eebef3a95391a9981dcba40e6cff26c054d89b8beb2f.png


from tkinter import *

window =Tk()
window.title("Pylearn Day 1")
window.geometry('1024x768')
lbl = Label(window, text="hello", font=("Arial Bold", 50))
lbl.grid(column=10, row=10)
def clicked():
lbl.configure(text="Button 2 was clicked !!", font=("Arial Bold", 14))
button_1 = Button(window, text="Button 1", bg="orange", fg="red")
button_2 = Button(window, text="Button 2", fg="blue", command=clicked)
button_1.grid(column=1, row=0)
button_2.grid(column=2, row=9)

window.mainloop()

Short but sweet for today.

How do you rate this article?

1


mytechtrail
mytechtrail

Old time maker, now into STEEM, Raspberry Pi and learning Python


mytechtrail
mytechtrail

Projects I am working on, Raspberry Pi, Python and Solar.

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?