问题
I am running into a display problem in Jupyter (both Classic and JupyterLab) for lists that include Arabic string elements and Latin Alphanumeric string elements. For example, if you run:
en = '7X'
print (en)
ar = 'عربي'
print (ar)
print ([en, ar])
print ([ar, en])
Here is what you get:
Obviously, where Arabic is the first element, Jupyter follows an RTL alignment displaying the ar
element first on the right, but I don't know why the 'X'
jumps from the alphanumeric element or how to fix that.
By the way, this is how Spyder prints out the same code:
回答1:
Click on the print out to switch it to the correct position.
>>> print([ar,en])
['عربي', '7X']
#Click Here^
I believe this is an error that only applies to Arabic. I tried it with Chinese without problem. I'll try to do more research on it and update this answer.
来源:https://stackoverflow.com/questions/48704303/jupyter-misdisplying-python-lists-with-arabic-and-alphanumeric-elements