问题
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