Python how to: open new window 🗔

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

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

  • @BroCodez
    @BroCodez  3 года назад +32

    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.

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

    Short and very useful video

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

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

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

    that was helpful bro

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

    Great video!

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

    its awsome thank you so so much

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

    U are good

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

    Thanks boss... Exactly what I was looking for

  • @yahyaaabdulaliibnmaryam7690
    @yahyaaabdulaliibnmaryam7690 Год назад +10

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

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

    You are great bro.....,🙏

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

    amazingg !!! thank you soo much.

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

    Nice. Thanks

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

    I find this code particularly useful,Thank you Bro for showing so much of everything ,but I do not understand that nearly ten thousand watched it and so few comments?

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

    awesome!

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

    Thank you Bro!

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

    great !! :)

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

    perfect thumbnail doesn't exi-

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

    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?

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

    Thank you

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

    Thank you Bro

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

    Wow!!!

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

    Nice;

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

    Ty bro!

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

    Thanks!

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

    thx dude

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

    This is very helpful.

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

    good vid

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

    nice

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

    ty

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

    amazing 🤩

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

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

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

    Great tutorial, good explanation without being too long.

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

    👍

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

    Bro 👏👏👏👏, you're amazing

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

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

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

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

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

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

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

    works :D

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

    How to add even more windows
    btw thanks for help

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

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

    IM A BRO NOW LETS GOOO :) love the video

  • @shivakumar-kd9zo
    @shivakumar-kd9zo 2 месяца назад +1

    thank you, but how to make text fields

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

    meow meow meow~!

  • @Flamer000
    @Flamer000 29 дней назад

    Ok

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

    How do i change the button size

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

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

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

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

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

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

    how do I title my new window?

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

    :)

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

    do you have to download files

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

    Can i find somewhere these commands?

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

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

    Is there a way to put ansi inside the window?

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

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

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

    hello bro

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

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

    How to change the name of the window

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

    offTheChain

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

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

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

    comment

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

    why does my cmd prompt open everytime i press start?

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

    bro i cant insert image on new Tk()

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

    is it possible without importS?

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

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

    how do w make it repeat itself

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

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

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

    How do I do this without any modules

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

      you need the tkinter module to do this

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

    19 Videos to go😂😂

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

    bad bro code

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

    ty

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

    comment