Raspberry Pi 3 Cookbook for Python Programmers
上QQ阅读APP看书,第一时间看更新

Running Pygame and Tkinter with X11 forwarding

You can get the following error (or similar) when running the Pygame or Tkinter scripts:

_tkinter.TclError: couldn't connect to display "localhost:10.0"  

In this case, use the following command to fix the error:

sudo cp ~/.Xauthority ~root/