Fix Python – Understanding lambda in python and using it to pass multiple arguments

After reading everything I can find on lambda, I still don’t understand how to make it do what I want.
Everyone uses the example:
lambda x, y : x + y

Why do you need to state both x and y before the 😕 Also how do you make it return multiple arguments?
for example:
self.buttonAdd_1 = Button(self, text=’+’, command=lambda : self.calculate(self.bu….

Fix Python – How do I close a tkinter window?

How do I end a Tkinter program? Let’s say I have this code:
from Tkinter import *

def quit():
# code to exit

root = Tk()
Button(root, text=”Quit”, command=quit).pack()

How should I define the quit function to exit my application?

Fix Python – Switch between two frames in tkinter?

I have built my first few scripts with a nice little GUI on them, as the tutorials have shown me, but none of them address what to do for a more complex program.
If you have something with a ‘start menu’, for your opening screen, and upon user selection you move to a different section of the program and redraw the screen appropriately, what is th….

Fix Python – Tkinter: “Python may not be configured for Tk”

Today I wanted to start working with Tkinter, but I have some problems.
Python 3.2 (r32:88445, Mar 28 2011, 04:14:07)
[GCC 4.4.5] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from tkinter import *
Traceback (most recent call last):
File ““, line 1, in
File “/usr/local/lib/python3.2/tkinter/_….

Fix Python – How to pip or easy_install tkinter on Windows

My Idle is throwing errors that and says tkinter can’t be imported.
Is there a simple way to install tkinter via pip or easy_install?
There seem to be a lot of package names flying around for this…
This and other assorted variations with tkinter-pypy aren’t working.
pip install python-tk

I’m on Windows with Python 2.7 and I don’t have apt-get o….

Fix Python – Dynamically updating plot in matplotlib

I am making an application in Python which collects data from a serial port and plots a graph of the collected data against arrival time. The time of arrival for the data is uncertain. I want the plot to be updated when data is received. I searched on how to do this and found two methods:

Clear the plot and re-draw the plot with all the points ag….

Fix Python – How to get the input from the Tkinter Text Widget?

How to get Tkinter input from the Text widget?
I asked this question to help others with the same problem – that is the reason why there is no example code. This issue had been troubling me for hours and I used this question to teach others. Please do not rate it as if it was a real question – the answer is the thing that matters.

Fix Python – How do you run your own code alongside Tkinter’s event loop?

My little brother is just getting into programming, and for his Science Fair project, he’s doing a simulation of a flock of birds in the sky. He’s gotten most of his code written, and it works nicely, but the birds need to move every moment.
Tkinter, however, hogs the time for its own event loop, and so his code won’t run. Doing root.mainloop() ru….

Fix Python – How can I create a simple message box in Python?

I’m looking for the same effect as alert() in JavaScript.
I wrote a simple web-based interpreter this afternoon using Twisted.web. You basically submit a block of Python code through a form, and the client comes and grabs it and executes it. I want to be able to make a simple popup message, without having to re-write a whole bunch of boilerplate w….