python sort records in file 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='')