Python tkinter how to open new windows 🗔

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • python how to open a new window tkinter GUI tutorial for beginners
    #python #new #window #tkinter #GUI #tutorial #beginners

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

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

    from tkinter import *
    def create_window():
    new_window = Tk() #Toplevel() = new window 'on top' of other windows, linked to a 'bottom' window
    #Tk() = new independent window
    #old_window.destroy() #close out of old window
    old_window = Tk()
    Button(old_window,text="create new window",command=create_window).pack()
    old_window.mainloop()

    • @amiral-ghanem1023
      @amiral-ghanem1023 3 года назад

      thanks for showing us how to make windows. i hav strugled to understand this part due to poor teaching but i only had to watch your vid once to understand

    • @specularboi
      @specularboi Год назад +1

      but how do i add text to the new menu?

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

    I am glade that this channel exists.

  • @yahyaaabdulaliibnmaryam7690
    @yahyaaabdulaliibnmaryam7690 2 года назад +10

    Finally some one who know how to teach a class with out all the other bs, thank you sir!!!

  • @littlehibiscus8118
    @littlehibiscus8118 Год назад +4

    This was very helpful with little baby beginners like me. Thank you.

  • @user-bh7vg8gd4q
    @user-bh7vg8gd4q 4 месяца назад +1

    Great video!

  • @motis6290
    @motis6290 Год назад +1

    i never like a video, but this is so good information, thanks alot, it feels good to see creators like you teach us. thanks again

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

    Short and very useful video

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

    perfect thumbnail doesn't exi-

  • @VQNEX_REAL
    @VQNEX_REAL 3 года назад +3

    that was helpful bro

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

    nice

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

    U are good

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

    good vid

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

    👍

  • @K3LP_STUDIØS
    @K3LP_STUDIØS Месяц назад

    Thank you so much!

  • @Gbrr
    @Gbrr 3 месяца назад

    Thank you

  • @Flamer000
    @Flamer000 2 месяца назад

    Ok

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

    Bro 👏👏👏👏, you're amazing

  • @Gigetto4419
    @Gigetto4419 Год назад +1

    Can you make a video on how to close the windows in the def i cant find a way

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

    IM A BRO NOW LETS GOOO :) love the video

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

    ty

  • @Monster-im6nu
    @Monster-im6nu Год назад

    Thank you Bro

  • @cristiucvladimir7909
    @cristiucvladimir7909 3 месяца назад

    Thanks!

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

    great !! :)

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

    Great tutorial, good explanation without being too long.

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

    its awsome thank you so so much

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

    Thank you Bro!

  • @InspireDaily-l2u
    @InspireDaily-l2u 3 месяца назад +1

    thank you, but how to make text fields

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

    You are great bro.....,🙏

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

    meow meow meow~!

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

    Nice. Thanks

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

    Both do the exact same thing for me Tk and top level, I’m trying to creat the same window also not a blank window maybe there is no way I need help

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

    How to add even more windows
    btw thanks for help

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

    Wow!!!

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

    Ty bro!

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

    Nice;

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

    amazingg !!! thank you soo much.

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

    thanks for the tutorial really helped to understand the basics of opening and closing windows but can you tell me how to make the top window also have a button that says "new window" so that u can infinitly open and close windows?

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

    Thanks boss... Exactly what I was looking for

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

    awesome!

  • @Xtrabytezgam
    @Xtrabytezgam 24 дня назад

    Im extremly new to python.

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

    thx dude

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

    hye bro, in youtube i never find someone who makes video about save label image as png,jpg and any kind of that.. can u make some video about that on tkinter.. appreciate u bro

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

    Thx a lot brother it helped a lot .
    But i had a problem can you pls tell like i wanna make a calculator then where do i have to write the code?
    After the old window main loop or somewhere else?

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

      idk broski but heres a realy bad cauculator if u want it
      print ("CAUACULATOR")
      print("ENTER A TOTAL OF 3 NUMBERS AND THEY WILL GET ADDED TOGETHER LIKE MAGIC")
      num1 = input("number 1: ")
      num2 = input("number 1: ")
      num3 = input("number 1: ")
      answer = (float(num1)) + (float(num3)) + (float(num2))
      print(answer)

    • @MrMeme-jh4ez
      @MrMeme-jh4ez 2 года назад

      make a new file, use a def statement and inside that def statement put the cal code. After that import that file and put the def name inside the code, hope this helps

    • @MrMeme-jh4ez
      @MrMeme-jh4ez 2 года назад

      @@someoneontheinternet3427 you forgot to change num2 and num3 inputs from "number 1" to "number 2" etc.

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

      @@MrMeme-jh4ez thx

  • @r4ndom-here
    @r4ndom-here 6 месяцев назад

    :)

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

    hello bro

  • @AhmadGaming6156
    @AhmadGaming6156 20 дней назад

    How to write something in that window like a Label

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

    just wondering how I would be able to edit/add buttons or text to the new window

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

  • @CS.9474
    @CS.9474 9 месяцев назад

    why after creating a new window either with Toplevel() or by Tk() we are not using .mainloop to create window it just directly creates one without .mainloop any reasons.....?

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

    amazing 🤩

  • @dankmemes5913
    @dankmemes5913 2 месяца назад

    how do i use "input" or "print" inside that window habibi

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

    offTheChain

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

    Is there a way to put ansi inside the window?

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

    This video is very helpful, thank you. How can I make sure to have only one child window?

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

    How should we code if we want to not allow closing the main window before closing the top window?

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

    Very poggers

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

    This is very helpful.

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

    How to change the name of the window

  • @user-ly5bp4th8y
    @user-ly5bp4th8y Год назад

    Can i find somewhere these commands?

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

    How to add multiple buttons to a window that does this same exact thing. Somebody help please

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

    why does my cmd prompt open everytime i press start?

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

    I don't know if you respond to comments, but I'm using pycharm and followed your code exactly but the window isn't popping up. Do you happen to know if I need a specific package to do this?

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

      If anyone else is having this problem I figured it out, make sure that when you go run your code you run the correct section. My issue was that there were two open and I was running main instead of the newly opened one

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

    how do i make my code from below run inside the window???

  • @a_star_official_
    @a_star_official_ Год назад +1

    is it possible without importS?

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

    How do i change the button size

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

    comment

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

    do you have to download files

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

    works :D

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

    How do I do this without any modules

    • @MrMeme-jh4ez
      @MrMeme-jh4ez 2 года назад

      you need the tkinter module to do this

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

    bro i cant insert image on new Tk()

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

    how do w make it repeat itself

    • @Im_a_jinx-4
      @Im_a_jinx-4 6 месяцев назад

      i think you can put this under while = example word and set the word to true ?

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

    how do you change the size of the window

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

      window.configure(width = size, height = size)
      But for me, the window doesn't change, after implement the button.

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

      NoGhost thanks a lot

    • @MrMeme-jh4ez
      @MrMeme-jh4ez 2 года назад +1

      window.geometry("size"x"size")

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

      @@MrMeme-jh4ez thanks

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

    19 Videos to go😂😂

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

    bad bro code

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

    ty

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

    comment