right-to-left languages in Python

自作多情 提交于 2019-11-28 04:03:15

问题


I want to write a Hebrew string in Python and then show it onscreen. The problem is that I get a mirror view of what I wrote. How can I set the string to use RTL instead of left to right?


回答1:


did you try this?

http://pypi.python.org/pypi/python-bidi/

http://pypi.python.org/pypi/django-bidi-utils

the Israeli FOSS comunnity is doing a lot in the direction, suprisingly, they happily collaborate also with Pharsi speakers :-)

pyfribidi for windows or any other bidi algorithm




回答2:


i know im pretty late to the party but you can allways use

" שלום hello "[::-1]

but the real solution is to use :

from bidi.algorithm import get_display
print(get_display("היי"))


来源:https://stackoverflow.com/questions/3856403/right-to-left-languages-in-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!