1
Tkinter Étiquette avec le texte arabe
est-il un moyen de faire que le texte arabe semble exactement comment il doit être: l'exemple ci-dessous devrait ressembler à « باطو »
Tkinter Étiquette avec le texte arabe
est-il un moyen de faire que le texte arabe semble exactement comment il doit être: l'exemple ci-dessous devrait ressembler à « باطو »
Depuis l'écriture arabe est droite à gauche , vous pouvez utiliser les bibliothèques: https://github.com/mpcabd/python-arabic-reshaper et https://github.com/MeirKriheli/python-bidi
Quelque chose comme cela peut fonctionner:
# !/usr/bin/python3
from tkinter import *
import arabic_reshaper
from tkinter import messagebox
from bidi.algorithm import get_display
text_to_be_reshaped = "ﺏﺎﻃﻭ"
reshaped_text = arabic_reshaper.reshape(text_to_be_reshaped)
bidi_text = get_display(reshaped_text)
top = Tk()
top.geometry("70x30")
B = Button(top, text = bidi_text)
B.place(x=0,y=0)
top.mainloop()
Possible copie de [texte arabe dans TKinter] (http://stackoverflow.com/questions/37964605/arabic-text-in-tkinter) – DyZ