writing lines by line alphabet order python code example
Example: python script to sort file content
with open('shopping.txt', 'r') as r:
for line in sorted(r):
print(line, end='')
with open('shopping.txt', 'r') as r:
for line in sorted(r):
print(line, end='')