Python - Tkinter over xrdp Display issue

612 Views Asked by At

I am learning about Python3 scripting/programming with this config:

  • My PC on win10
  • remote PC under my tv with Debian 9 on it.

I installed xrdp to get a remote graphical UI to play around with Tkinter.

I wrote this very simple script :

#!/usr/bin/env python3
#coding: utf-8

from tkinter import *

fenetre = Tk()

label = Label(fenetre, text="Hello World")
label.pack()

fenetre.mainloop()

But I hit an issue:

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

I understand that's linked to xrdp because if I try it physically on the pc it works well. Any idea or workaround? :/

Thank you !

1

There are 1 best solutions below

0
On

I used this with Python3.10 on Ubuntu 20.4 with xrdp and hyper-v running on Windows 11 and it works.

import tkinter as tk

window = tk.Tk()

label = tk.Label(window, text="Hello World")
label.pack()

window.mainloop()