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()
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
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?
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?
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)
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
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
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?
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
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.....?
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()
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
but how do i add text to the new menu?
I am glade that this channel exists.
This was very helpful with little baby beginners like me. Thank you.
Great video!
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
Finally some one who know how to teach a class with out all the other bs, thank you sir!!!
Short and very useful video
Can you make a video on how to close the windows in the def i cant find a way
Well Well......
that was helpful bro
Thank you
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?
perfect thumbnail doesn't exi-
thank you, but how to make text fields
Great tutorial, good explanation without being too long.
Nice. Thanks
Thank you so much!
delicious video
its awsome thank you so so much
Bro 👏👏👏👏, you're amazing
thanks Mon Wil!
You are great bro.....,🙏
U are good
Thank you Bro
meow meow meow~!
Thanks!
👍
Thank you Bro!
This is very helpful.
amazingg !!! thank you soo much.
nice
IM A BRO NOW LETS GOOO :) love the video
great !! :)
good vid
Thanks boss... Exactly what I was looking for
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
ty
How to add even more windows
btw thanks for help
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?
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)
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
@@someoneontheinternet3427 you forgot to change num2 and num3 inputs from "number 1" to "number 2" etc.
@@MrMeme-jh4ez thx
awesome!
Im extremly new to python.
Wow!!!
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
just wondering how I would be able to edit/add buttons or text to the new window
Ty bro!
Ok
How should we code if we want to not allow closing the main window before closing the top window?
This video is very helpful, thank you. How can I make sure to have only one child window?
Is there a way to put ansi inside the window?
Nice;
❤
How to write something in that window like a Label
how do i use "input" or "print" inside that window habibi
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?
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
Can i find somewhere these commands?
thx dude
is it possible without importS?
no
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.....?
so it uses the window.mainloop which is in the bottom window toplevel
How to change the name of the window
how do i make my code from below run inside the window???
How do i change the button size
do you have to download files
why does my cmd prompt open everytime i press start?
How to add multiple buttons to a window that does this same exact thing. Somebody help please
How do I do this without any modules
you need the tkinter module to do this
amazing 🤩
hello bro
how do you change the size of the window
window.configure(width = size, height = size)
But for me, the window doesn't change, after implement the button.
NoGhost thanks a lot
window.geometry("size"x"size")
@@MrMeme-jh4ez thanks
works :D
bro i cant insert image on new Tk()
:)
Very poggers
offTheChain
how do w make it repeat itself
i think you can put this under while = example word and set the word to true ?
comment
19 Videos to go😂😂
You're doing great Game tOut!
@@BroCodez awwww thank you❤
bad bro code
ty
comment