Learn Python tkinter GUI scales easy 🌡️

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024
  • Python Tkinter GUI scale slider tutorial for beginners
    #Python #Tkinter #GUI #scale #slider #tutorial #beginners

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

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

    from tkinter import *
    def submit():
    print("The temperature is: "+ str(scale.get())+ " degrees C")
    window = Tk()
    hotImage = PhotoImage(file='hot.png')
    hotLabel = Label(image=hotImage)
    hotLabel.pack()
    scale = Scale(window,
    from_=100,
    to=0,
    length=600,
    orient=VERTICAL, #orientation of scale
    font = ('Consolas',20),
    tickinterval = 10, #adds numeric indicators for value
    #showvalue = 0, #hide current value
    resolution = 5, #increment of slider
    troughcolor = '#69EAFF',
    fg = '#FF1C00',
    bg = '#111111'
    )
    scale.set(((scale['from']-scale['to'])/2)+scale['to']) #set current value of slider
    scale.pack()
    coldImage = PhotoImage(file='cold.png')
    coldLabel = Label(image=coldImage)
    coldLabel.pack()
    button = Button(window,text='submit',command=submit)
    button.pack()
    window.mainloop()

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

    GREAT VIDEO

  • @jeswins7128
    @jeswins7128 3 года назад +8

    If you replace the + with a comma then you don't need to cast it to a string..
    Hope it helped

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

    Because;;; I like the video 👍

  • @tatbysaeed3290
    @tatbysaeed3290 9 месяцев назад

    great tutorial :) but a question , when you creating a label object why you didn't insert the master "window" ?

  • @Wideopen69
    @Wideopen69 2 года назад +2

    Hey Bro of codes 🙂
    first of all thank you for your great content👌
    As a newbie in the python world could you please give me a tip how to use the generated number values in a function to setup the brightness of a RGB-LCD.
    Many thanks in advance 🍻
    Cheers

  • @Data_Falcon
    @Data_Falcon 4 месяца назад

    bro it is very usefull

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

    another perfect tutorial!! thanks as always :)

  • @user-gs5hg6ek9x
    @user-gs5hg6ek9x 6 месяцев назад

    great video!

  • @truquichan
    @truquichan 11 месяцев назад

    Great!

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

    Where do you get these 50x50 images

    • @tatbysaeed3290
      @tatbysaeed3290 9 месяцев назад

      yeah :) I couldn't find them anywhere

  • @DJL7777
    @DJL7777 9 месяцев назад

    just curious: Why have you stopped using f strings this late in the tutorials?? 😵‍💫 did we go back in time or something?

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

    thank u

  • @krishma1680
    @krishma1680 8 месяцев назад

    Tripta

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

    Wow!

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

    meow meow meow~!

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

    شكرا

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

    thanks

  • @adam-vip
    @adam-vip 2 года назад

    👍

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

    Ty bro!

  • @hamzazad5258
    @hamzazad5258 5 месяцев назад

    i couldnt add the images properly, there is a huge space between the images and the scale isk how to fix that :(

  • @ba.youtube1007
    @ba.youtube1007 2 года назад +1

    Hello Brocode, How can i resize the image fire and snowflakes? mine is so big

    • @ba.youtube1007
      @ba.youtube1007 2 года назад

      nvm I just used photoshop to resize the image i have downloaded but I can accept any programing tips to resize it directly on pycharm...
      P.S.: i tried installing pillow or PIL module but I cant import it now matter what i do

    • @raedshaher5186
      @raedshaher5186 2 года назад +1

      @@jamesorpilla actually pycharm can install it for you!
      go to file--> setting--> project --> python interpreter
      and click on the + button and search for PIL and click install.
      then you can import

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

    u play game , noice

  • @orfredymelobeltran5237
    @orfredymelobeltran5237 2 года назад +1

    so i was lazy copy the code and remplece the hot and cold img for the pizza and hotdog XD

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

      lol, I never thought about food on a sliding scale 🤔

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

    yup

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

    I CANT FIND THE SCALE OPTION IN MY PYCHARM WHY ??

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

    This is a 100 on my scale

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

    I'd like to make an 8 channel mixing board. How would I install more slide bars? Is there a separate command for that, or would I just reiterate something like in the video? Thx

  • @2907Prashantyerunkar
    @2907Prashantyerunkar 2 года назад

    how to copy the code and from where ?

  • @pet.me102
    @pet.me102 Год назад +1

    Lol you didn't explain resolution, you edit skipped it 😂

    • @user-fo7yr1xj6q
      @user-fo7yr1xj6q 9 месяцев назад

      yes and that i had to google it and ask chatgpt instead haha

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

    y