2

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 !

Dinko Pehar
  • 5,454
  • 4
  • 23
  • 57
JoeJinis
  • 31
  • 3
  • So are you remoted into your Debian pc and trying to run python from there? Are you using SSH? – Mike - SMT Nov 14 '18 at 15:45
  • Not SSH but xrdp, compatible with windows remote desktop manager. Trying to play with graphical objects could by a little handy in SSH ;p – JoeJinis Nov 14 '18 at 16:57
  • Related [cannot-open-display-while-running-x-apps-as-another-user](https://stackoverflow.com/questions/30063218/cannot-open-display-while-running-x-apps-as-another-user) and [xrdp.ini](https://www.systutorials.com/docs/linux/man/5-xrdp.ini/) – stovfl Nov 14 '18 at 18:16
  • That didn't change anything sadly :/ But the title of the topic enlighted me a bit, it may indeed be an user related problem because I launch the xrdp session as joe and play in the terminal as root, investigations continue ! – JoeJinis Nov 15 '18 at 12:27

1 Answers1

0

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()
Freddy Mcloughlan
  • 4,129
  • 1
  • 13
  • 29
stevem
  • 1
  • 1