aboutsummaryrefslogtreecommitdiff
path: root/sort.py
diff options
context:
space:
mode:
authorHolden Rohrer <hdawg7797@yahoo.com>2019-08-02 11:57:17 -0400
committerHolden Rohrer <hdawg7797@yahoo.com>2019-08-02 11:57:17 -0400
commit6253f5563c1688c8cd6cb09a6669796e983bc869 (patch)
treee5a9d502ef0dfa9751d709d31dda391f3b413400 /sort.py
parentaad153f208ccc6261b32569b29ffedd404491064 (diff)
working alphabetization
Diffstat (limited to 'sort.py')
-rw-r--r--sort.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sort.py b/sort.py
index 00007bc..1a38450 100644
--- a/sort.py
+++ b/sort.py
@@ -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]))