Python tkinter how to open new windows 🗔

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

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

  • @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 года назад +2

    I am glade that this channel exists.

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

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

  • @HaiNguyen-k1k6o
    @HaiNguyen-k1k6o 6 месяцев назад +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

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

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

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

    Short and very useful video

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

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

  • @hydarhydar2338
    @hydarhydar2338 15 часов назад

    Well Well......

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

    that was helpful bro

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

    Thank you

  • @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?

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

    perfect thumbnail doesn't exi-

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

    thank you, but how to make text fields

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

    Great tutorial, good explanation without being too long.

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

    Nice. Thanks

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

    Thank you so much!

  • @Tree_Gamer
    @Tree_Gamer 19 дней назад

    delicious video

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

    its awsome thank you so so much

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

    Bro 👏👏👏👏, you're amazing

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

    You are great bro.....,🙏

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

    U are good

  • @Monster-im6nu
    @Monster-im6nu 2 года назад

    Thank you Bro

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

    meow meow meow~!

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

    Thanks!

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

    👍

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

    Thank you Bro!

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

    This is very helpful.

  • @ab123-j7v
    @ab123-j7v 3 года назад +1

    amazingg !!! thank you soo much.

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

    nice

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

    IM A BRO NOW LETS GOOO :) love the video

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

    great !! :)

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

    good vid

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

    Thanks boss... Exactly what I was looking for

  • @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

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

    ty

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

    How to add even more windows
    btw thanks for help

  • @shanereacts8191
    @shanereacts8191 3 года назад +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 года назад +1

      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 года назад +1

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

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

      @@MrMeme-jh4ez thx

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

    awesome!

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

    Im extremly new to python.

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

    Wow!!!

  • @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

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

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

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

    Ty bro!

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

    Ok

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

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

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

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

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

    Is there a way to put ansi inside the window?

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

    Nice;

  • @hydarhydar2338
    @hydarhydar2338 22 дня назад

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

    How to write something in that window like a Label

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

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

  • @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

  • @ICS-b8u
    @ICS-b8u Год назад

    Can i find somewhere these commands?

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

    thx dude

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

    is it possible without importS?

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

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

    • @youssefomar5512
      @youssefomar5512 Месяц назад

      so it uses the window.mainloop which is in the bottom window toplevel

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

    How to change the name of the window

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

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

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

    How do i change the button size

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

    do you have to download files

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

    why does my cmd prompt open everytime i press start?

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

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

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

    How do I do this without any modules

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

      you need the tkinter module to do this

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

    amazing 🤩

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

    hello bro

  • @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

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

    works :D

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

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

    bro i cant insert image on new Tk()

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

    :)

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

    Very poggers

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

    offTheChain

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

    how do w make it repeat itself

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

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

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

    comment

  • @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