import arabic_reshaper text_to_be_reshaped = 'اللغة العربية رائعة' reshaped_text = arabic_reshaper.reshape(text_to_be_reshaped) rev_text = reshaped_text[::-1] # slice backwards print(rev_text)