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