Bonjour,
Le code python suivant devrait s'exécuter normalement https://www.developpez.net/forums/d2.../#post11519546
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import tkinter as tk
import tkinter.font as tkfont
from tkinter.scrolledtext import ScrolledText
 
root = tk.Tk()
frame = tk.LabelFrame(root, text="Polices")
frame.grid()
ft = tkfont.families()
txt = ScrolledText(frame, width=50, height=20)
txt.grid()
 
txt.insert("1.0", 'Polices:\n')
txt.tag_add("tagpolices", "1.0", "insert")
 
for i,f in enumerate(ft):
    font = tkfont.Font(frame, size=20, family=f)
    tag = f'tag{i}'
    txt.tag_config(tag, font=font)
    txt.insert("end", f, tag, '\n')
 
root.mainloop()
Or avec mon pc sous ubuntu 18.04 Mate, je rencontre une erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
python3 BIDON.py 
X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  20 (RenderAddGlyphs)
  Serial number of failed request:  689
  Current serial number in output stream:  783
Qu'en est il?