Hello. I am have a problem while trying to write to a file some sorted lines . my initial file is somthing like this
name2,number2;name3,number3;name1,number1
when i run this code
ord = open("Be.csv", 'r')
order = ord.read().split(";")
order = sorted(order)
for sort in order:
print sort
ord.close()
f=open("Odd.csv","w")
f.write(sort)
f.close()
Even if it prints in shell all the lines i want and of course sorted in the new file it will only write name3,number3
What might seem to be the problem?
if someone has any ideea i would be grateful.