Teaching myself Python Day 1

in ulog •  7 months ago 

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.
pylearnday1.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.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

@mytechtrail, when did you start to learn how to write code with Python?

Posted using Partiko Android

I do not consider my self a programmer, but I have been writing basic Python code off and on for over a year. I have written basic (dBase, C, Visual Basic, Perl) code in for over 25 years.

You got a GUI? Doing better than me. Anything related to UI just destroys me.

Well Tk is included with Python 3 installs, so just an import.

Web UI will come much later....

  ·  7 months ago Reveal Comment
Loading...

Good luck! I remember starting to code many years ago. Switched languages many times. Tried different frameworks and plattforms. Somehow the early stages are the most satisfying ones. Stuff is simple and progression is fast.
Good old times...

Posted using Partiko Android