Related question: Mac OS X: _tkinter.TclError: no display name and no $ DISPLAY environment variable
The above problem has the same problem, but the answer to this question is not applicable to me.
a.py
from Tkinter import * root = Tk() canvas = Canvas(bg='white', width = 200, height = 200) canvas.pack() canvas.create_line(0, 0, 199, 199, fill="blue", width = 5) canvas.create_line(0, 199, 199, 0, fill="blue", width = 5) canvas.update() canvas.postscript(file = "x.ps") root.mainloop()
a.py is on a remote server
This works great when I connect to the server via VNC and start it.
But when I connect to the server via Putty on the windows and start it, it gives me "no display name and environment variable diplay"
1) Is it possible to run this through Putty?
2) Can python find out if the connection is connected with putty and maybe raise my own error instead of TclError?
python putty
ealeon
source share