def quit(self): self.root.destroy()
Add parentheses after destroy
to call the method.
When you use command=self.root.destroy
you pass the method to Tkinter.Button
without the parentheses because you want Tkinter.Button
to store the method for future calling, not to call it immediately when the button is created.
But when you define the quit
method, you need to call self.root.destroy()
in the body of the method because by then the method has been called.
Related Posts:
- PermissionError: [Errno 13] Permission denied
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ImportError: No module named ‘Tkinter’
- How to pip or easy_install tkinter on Windows
- matplotlib error – no module named tkinter
- tkinter gui with progress bar
- filedialog, tkinter and opening files
- How can I create a dropdown menu from a List in Tkinter?
- How do I insert a JPEG image into a python Tkinter window?
- TypeError: generatecode() takes 0 positional arguments but 1 was given
- Tkinter understanding mainloop
- takes 1 positional argument but 2 were given
- How to pass arguments to a Button command in Tkinter?
- Tkinter scrollbar for frame
- Tkinter understanding mainloop
- AttributeError: ” object has no attribute ”
- matplotlib error – no module named tkinter
- How to use an image for the background in tkinter?
- How to update a plot in matplotlib?
- Windows- Pyinstaller Error “failed to execute script ” When App Clicked
- Using Tkinter in python to edit the title bar
- Difference between import tkinter as tk and from tkinter import
- Disable / Enable Button in TKinter
- How to clear Tkinter Canvas?
- How to handle a Button click event
- tkinter gui layout using frames and grid
- Tkinter error: Couldn’t recognize data in image file
- Strange Exception in Tkinter callback
- How do I compile my Python 3 app to an .exe?
- How can I parse a YAML file in Python
- Cannot find module cv2 when using OpenCV
- Maximum and Minimum values for ints
- How is Anaconda related to Python?
- What is the python keyword “with” used for? [duplicate]
- What is the purpose of meshgrid in Python / NumPy?
- How to add to the PYTHONPATH in Windows, so it finds my modules/packages?
- FileNotFoundError: [WinError 2] The system cannot find the file specified:
- Remove all whitespace in a string
- What is a “method” in Python?
- How to generate all permutations of a list?
- Is there a Python equivalent to Ruby’s string interpolation?
- Python Progress Bar
- SyntaxError: non-default argument follows default argument
- socket.error: [Errno 48] Address already in use
- Creating a basic auto clicker in python
- What’s the difference between torch.stack() and torch.cat() functions?
- proper name for python * operator?
- How to do superscripts and subscripts in Jupyter Notebook?
- How do I unload (reload) a Python module?
- How to disable Python warnings?
- LinAlgError: Last 2 dimensions of the array must be square
- How to get data from SNMP with python?
- What does axis in pandas mean?
- Dynamically growing a python array when assigning to it
- “OverflowError: Python int too large to convert to C long” on windows but not mac
- Can’t compare naive and aware datetime.now() <= challenge.datetime_end
- List of zeros in python
- How to remove an element from a list by index
- How to add title to subplots in Matplotlib
- List attributes of an object [duplicate]
- How can I set the aspect ratio in matplotlib?
- In Python how should I test if a variable is None, True or False
- Pythonic way to iterate through a range starting at 1
- Convert from CSV to array in Python
- AttributeError: ‘list’ object has no attribute ‘replace’ when trying to remove character
- ValueError: unsupported pickle protocol: 3, python2 pickle can not load the file dumped by python 3 pickle?
- Relative paths in Python
- Convert bytes to int?
- SQLAlchemy ORDER BY DESCENDING?
- ValueError: unsupported pickle protocol: 3, python2 pickle can not load the file dumped by python 3 pickle?
- Relative paths in Python
- AttributeError(“‘str’ object has no attribute ‘read'”)
- What is PEP8’s E128: continuation line under-indented for visual indent?
- PyQt is thread-safe to the same extent that Qt is thread-safe. The Qt docs will tell you which parts of their API are guaranteed to be so, and under what circumstances.
- How to downgrade the installed version of ‘pip’ on windows?
- Where do I get a SECRET_KEY for Flask?
- What does |= (ior) do in Python?
- How can I find the first occurrence of a sub-string in a python string?
- NumPy List Comprehension Syntax
- Unsupported operation :not writeable python
- RuntimeError: Invalid DISPLAY variable
- bash: mkvirtualenv: command not found
- Convert a Unicode string to a string in Python (containing extra symbols)python string unicode type-conversion
- Python Django: You’re using the staticfiles app without having set the STATIC_ROOT setting
- sqlite3.OperationalError: unable to open database file
- Object of type ‘map’ has no len() in Python 3
- How to uninstall jupyter
- Python CSV error: line contains NULL byte
- python NameError: name ‘file’ is not defined
- python BeautifulSoup parsing table
- Python Add to dictionary loop
- Python official installer missing python27.dll
- TypeError: ‘range’ object does not support item assignment
- Convert string to variable name in python
- Generate a random letter in Python
- NameError from Python input() function
- How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?
- Syntax highlighting in vim for python
- AttributeError: ‘Series’ object has no attribute ‘split’ error in sending emails