Learn Python tkinter GUI user input easy ⌨️

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • НаукаНаука

Комментарии • 26

  • @BroCodez
    @BroCodez  4 года назад +4

    # entry widget = textbox that accepts a single line of user input
    from tkinter import *
    def submit():
    username = entry.get() #gets entry text
    print("Hello "+username)
    def delete():
    entry.delete(0,END) #deletes the line of text
    def backspace():
    entry.delete(len(entry.get())-1,END) #delete last character
    window = Tk()
    window.title("user input")
    label = Label(window,text="username: ")
    label.config(font=("Consolas",30))
    label.pack(side=LEFT)
    submit = Button(window,text="submit",command=submit)
    submit.pack(side = RIGHT)
    delete = Button(window,text="delete",command=delete)
    delete.pack(side = RIGHT)
    backspace = Button(window,text="backspace",command=backspace)
    backspace.pack(side = RIGHT)
    entry = Entry()
    entry.config(font=('Ink Free',50)) #change font
    entry.config(bg='#111111') #background
    entry.config(fg='#00FF00') #foreground
    entry.config(width=10) #width displayed in characters
    #entry.insert(0,'Spongebob') #set default text
    #entry.config(state=DISABLED) #ACTIVE/DISABLED
    #entry.config(show='*') #replace characters shown with x character
    entry.pack()
    window.mainloop()

  • @surferkwsurferkw8910
    @surferkwsurferkw8910 Год назад +2

    clear, easy to understand and very useful tutorial. Great!

  • @joyomanda375
    @joyomanda375 Месяц назад +1

    Thanks a lot! ☺

  • @akuncoba84
    @akuncoba84 3 года назад +2

    Ok. your video, helped me...
    Thankfull

  • @dishant_7
    @dishant_7 4 месяца назад +1

    Super helpful. ❤

  • @lw_w3
    @lw_w3 3 года назад +1

    Thank you my brother i from iraq i abaric
    you helo me now thank you
    i like you and i Subscribe to your channel

  • @YouGotCAGEDyt
    @YouGotCAGEDyt 2 года назад

    This feels me like gigachad is behind pc lol

  • @Sheharyar69420
    @Sheharyar69420 18 дней назад

    Wow!

  • @mikemurphy1896
    @mikemurphy1896 2 года назад

    How would I get multiple user data entry inputs and display those inputs on a separate text line? Maybe even type out simultaneously on that separate line as well, in GUI format?
    Thanks. Your vids are great!!!

  • @user-fn3xp7mk3e
    @user-fn3xp7mk3e 4 года назад +1

    The name of the porgram you imagined by video

  • @econtutor10
    @econtutor10 Год назад

    super! is there a way to also show py console output in a ttk widget?

  • @rohitbankar7437
    @rohitbankar7437 6 месяцев назад

    Awesome

  • @vedant__kadu
    @vedant__kadu 3 года назад

    Is there any way that I can add some text with the entry widget for user to know what to enter? like a placeholder or something

  • @No-t-h-i-n-g
    @No-t-h-i-n-g Год назад

    TypeError: expected string or bytes-like object, got 'dict'

  • @XMegaJuni
    @XMegaJuni 3 года назад

    I get an error that self.tk.cakk(_tkinter.TclError: can't invoke "button" command: Application has been destoryed

    • @hillybankok
      @hillybankok 2 года назад

      you need to name the button() to Button() with caps

  • @glensonwilsondsouza7218
    @glensonwilsondsouza7218 Год назад

    Amazing Broooo!!!

  • @NameEnter-nj1cx
    @NameEnter-nj1cx Год назад

    do you have videos about padX and padY?

  • @leum5272
    @leum5272 2 года назад

    Can we make a backspace command on label

  • @thanthanthanthan9742
    @thanthanthanthan9742 2 года назад

    Thanks bro

  • @alemkiros7888
    @alemkiros7888 2 года назад

    wow!

  • @deepdaddy1208
    @deepdaddy1208 4 года назад +1

    how is going bro

    • @BroCodez
      @BroCodez  4 года назад

      hey!

    • @deepdaddy1208
      @deepdaddy1208 4 года назад +2

      @@BroCodez keep those videos coming, i know you might not get the views you want yet but some of us enjoy them