Update text-gen
This commit is contained in:
parent
642c24108e
commit
43c2a1a326
12326
hp/hodbook.txt
Normal file
12326
hp/hodbook.txt
Normal file
File diff suppressed because it is too large
Load Diff
8
hp/hp.py
8
hp/hp.py
@ -1,4 +1,10 @@
|
||||
#!/bin/python3
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print(sys.argv)
|
||||
exit("Please provide a filename as argument")
|
||||
filename = sys.argv[-1]
|
||||
|
||||
def colorize(word):
|
||||
return f"\u001b[0;33m{word}\u001b[0m"
|
||||
@ -16,7 +22,7 @@ import re
|
||||
chapter_pattern = re.compile("^CHAPTER")
|
||||
page_pattern = re.compile("^\d+$")
|
||||
|
||||
with open("hp.txt") as f:
|
||||
with open(filename) as f:
|
||||
lines = f.readlines()
|
||||
|
||||
print("Stripping excess data")
|
||||
|
Loading…
Reference in New Issue
Block a user