Jupyter misdisplying Python lists with Arabic and alphanumeric elements

爱⌒轻易说出口 提交于 2021-01-28 08:34:05

问题


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

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