archeaopteryx / texAbstractCleaner

short python script meant to remove header information from .tex abstractions for inclusion in a workshop booklet
1 stars 1 forks source link

csv abuse #4

Open Bunkerbewohner opened 7 years ago

Bunkerbewohner commented 7 years ago

You're sort of abusing the csv module there, at least right up until the end where you're actually using it as intended to write your "ListOfAbstracts.txt". ^_^

Just so you know, to read a file line by line (getting a simple list of strings, one string for each line), you can just use the file's readlines() method, e.g.:

def readlines(path):
  with open(path) as file:
    return file.readlines()

# print document line by line
for line in readlines("document.tex"):
  print(line + "\n")
Bunkerbewohner commented 7 years ago

for reference: