Skip to content

Instantly share code, notes, and snippets.

@apisznasdin
Created August 27, 2015 01:18
Show Gist options
  • Save apisznasdin/cdf21f1f425ae23bdcb0 to your computer and use it in GitHub Desktop.
Save apisznasdin/cdf21f1f425ae23bdcb0 to your computer and use it in GitHub Desktop.

Revisions

  1. apisznasdin created this gist Aug 27, 2015.
    7 changes: 7 additions & 0 deletions list_sorting.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    file_1 = open("input.txt", "r")
    file_2 = open("output.txt","r+")
    mylist = sorted(file_1.read().split(','), key=str.lower)
    for line in mylist:
    file_2.write(","+line)
    file_1.close()
    file_2.close()