'How to read txt files with those languages which is read from right to left with python
Solution 1:[1]
Solution 2:[2]
The simple solution is to print the reversed text:
print(text[::-1])
Another solution is to use a bi-directional library python-bidi
from bidi.algorithm import get_display
f = open("line.txt",encoding="utf-8")
text = f.read()
print(get_display(text))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mbpy |
| Solution 2 | Hamed Rabiei |

