diff options
author | Holden Rohrer <hdawg7797@yahoo.com> | 2019-08-02 11:57:17 -0400 |
---|---|---|
committer | Holden Rohrer <hdawg7797@yahoo.com> | 2019-08-02 11:57:17 -0400 |
commit | 6253f5563c1688c8cd6cb09a6669796e983bc869 (patch) | |
tree | e5a9d502ef0dfa9751d709d31dda391f3b413400 /sort.py | |
parent | aad153f208ccc6261b32569b29ffedd404491064 (diff) |
working alphabetization
Diffstat (limited to 'sort.py')
-rw-r--r-- | sort.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2,7 +2,7 @@ #Inputs file sort.tex, to sort as read, takes all data, and then reopens as write f = open('sort.tex','r') -dat = f.readlines() +dat = f.readline().split('\\par ') f.close() f = open('sort.tex','w') @@ -24,4 +24,4 @@ for lineind in range(len(dat)): dat[lineind] = firstgroup(line) dat.sort(key=lambda text : [ord(char) for char in text[0]]) -f.write(''.join([line[1] for line in dat])) +f.write('\\par'.join([line[1] for line in dat])) |