I saw too much question here no one answered my question. I have text file ckb.txt :
چ
چۆنی
باشی
سوپاس
ئاسمان
یاسا
دەنگ
چنار
کورستانی گەورە
I want to remove any line which len() is more than 4 characters, I wrote this simple code but not working, Any suggestion or tip?
import arabic_reshaper
from bidi.algorithm import get_display
import unicodedata
with open("ckb.txt", 'r+', encoding='utf-8') as f:
g = f.readlines()
for line in g:
print(get_display(arabic_reshaper.reshape(line)))
print(len(line))
if len(line) > 4:
del line