on python3 , i want to sort a list of arabic words IN THE ALPHABETIC ORDER the file i have has this content
حصل,شد
حصن,حضا
حضر,جا
حض,أكد
حضن,تهلا
حطب,حطب
حطم,هرس
and i want to sort it by the first column so the output become
حض,أكد
حصن,حضا
حطب,حطب
حضن,تهلا
حضر,جا
حصل,شد
حطم,هرس
i tried using the function sort it didn't work i think i m missing something
my code is something like that
# coding=utf-8
import csv
import sort
d=[]
with open('sort.csv', 'a+', encoding='utf-8' , newline='\n') as in_fp:
with open('result.csv','w', encoding='utf-8' , newline='\n') as out_fp:
for row in (csv.reader(in_fp, delimiter=',')):
d.append=row[1]
d.sort()
and then i want to save it in the result.csv
i found this link! but i don't it is working for me