Tkinter “module not callable” error.

0 votes

Hi. I am trying to write a python code with tkinter. This is my code:

import Tkinter as Tk

root = Tk()

And I am getting this error:

root = Tk()

TypeError: 'module' object is not callable

How to solve this?

May 8 in Python by Aman
27 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
Tk() is a module and not a method. You have to call the Tk() method from the tkinter module. Try this:
import Tkinter as tk

root = tk.Tk()

This should work
answered May 8 by Yash

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 65,810 points
630 views
0 votes
1 answer

Python error "NameError: name 'sr' is not defined"

I guess you are using speech_recognition module and missing ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 65,810 points
1,668 views
0 votes
2 answers
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 920 points
19 views
+4 votes
6 answers
0 votes
1 answer

Python Tkinter: “‘Label’ unresolved” error

You have imported Tkinter as tk but ...READ MORE

answered May 8 in Python by Rishi
6 views
0 votes
1 answer

Tkinter error: tkinter.TclError: bad geometry specifier

You have to use the character ‘x’ ...READ MORE

answered May 8 in Python by Tina
13 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.