gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
make gui window bigger in python
- User
make gui window bigger in python
- Assistant
To make a GUI window bigger in Python, you can use the
geometrymethod ofTk()orToplevel()class from the tkinter module. Here's an example:from tkinter import Tk # Create the root window root = Tk() # Set the initial size of the window root.geometry("300x200") # Function to make the window bigger def make_bigger(): root.geometry("500x400") # Button to trigger the resize btn = Button(root, text="Make Bigger", command=make_bigger) btn.pack() # Run the main event loop root.mainloop()In this example, initially, the window is set to a size of 300 pixels wide and 200 pixels high. When the "Make Bigger" button is clicked, it calls the
make_biggerfunction, which changes the window size to 500 pixels wide and 400 pixels high.