_tkinter.TclError: no display name and no $DISPLAY environment variable

I am running a simple python script in the server: import matplotlib.pyplot as plt import numpy as np x = np.random.randn(60) y = np.random.randn(60) plt.scatter(x, y, s=20) out_png = ‘path/to/store/out_file.png’ plt.savefig(out_png, dpi=150) I try to use the command python example.py in this server which has matplotlib 1.5.1 installed it fails with the error: Traceback (most … Read more

How to pass arguments to a Button command in Tkinter?

Suppose I have the following Button made with Tkinter in Python: import Tkinter as Tk win = Tk.Toplevel() frame = Tk.Frame(master=win).grid(row=1, column=1) button = Tk.Button(master=frame, text=”press”, command=action) The method action is called when I press the button, but what if I wanted to pass some arguments to the method action? I have tried with the … Read more

Create a directly-executable cross-platform GUI app using Python

Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some … Read more