takes 1 positional argument but 2 were given

It is because you are providing it a positional argument here: command want’s a callback function. and you are passing it the response from the adb method. (see here fore more: http://effbot.org/tkinterbook/button.htm) when that line is being called, self.adb(“devices”) is being called. if you look at your definition of adb You are only asking for 1 positional argument self and any number of … Read more

Tkinter understanding mainloop

tk.mainloop() blocks. It means that execution of your Python commands halts there. You can see that by writing: You will never see the output from the print statement. Because there is no loop, the ball doesn’t move. On the other hand, the methods update_idletasks() and update() here: …do not block; after those methods finish, execution will continue, so the while loop will … Read more

TypeError: generatecode() takes 0 positional arguments but 1 was given

When you call a method on a class (such as generatecode() in this case), Python automatically passes self as the first argument to the function. So when you call self.my_func(), it’s more like calling MyClass.my_func(self). So when Python tells you “generatecode() takes 0 positional arguments but 1 was given”, it’s telling you that your method is set up to take no … Read more

matplotlib error – no module named tkinter

For Linux Debian based distros: RPM based distros: For windows: For Windows, I think the problem is you didn’t install complete Python package. Since Tkinter should be shipped with Python out of box. See: http://www.tkdocs.com/tutorial/install.html . Good python distributions for Windows can be found by the companies Anaconda or ActiveState. Test the python module p.s. I suggest … Read more

How to pip or easy_install tkinter on Windows

Well I can see two solutions here: 1) Follow the Docs-Tkinter install for Python (for Windows): Tkinter (and, since Python 3.1, ttk) are included with all standard Python distributions. It is important that you use a version of Python supporting Tk 8.5 or greater, and ttk. We recommend installing the “ActivePython” distribution from ActiveState, which includes everything … Read more