Click here to Skip to main content
14,921,143 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to use reshaperin And bidi in python for convert some arabic Text

my question is how can i use arabic-reshaper for convert text inside of a txt file and save converted text in other txt file

its my code for convert one line

import arabic_reshaper
from bidi.algorithm import get_display
text = 'سلام محمد خوبی'

test = arabic_reshaper.reshape(text)

i know its a easy question But I haven't worked with Python until today tnx

What I have tried:

im new at python and for this do not know much
Updated 23-Mar-20 7:15am

1 solution

See 7. Input and Output — Python 3.7.7 documentation[^]. You just need to read the input line by line, apply the reshaper to the text and write the new text to the output file.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900