Jun-13-2019, 03:02 AM
I have text documents. They consist of 1 sentence on each line, maybe 35 lines. I want to add the correct sentence from the answers text file under each line and give the whole thing a bit of formatting.
I think pprint presents text neatly. Can it do simple formatting and write to a text file?
I basically want an indent and some space at the top and/or bottom and some line spacing.
When I batch print the text files I have from a bash terminal, the text is left, no margin, top, no margin.
I can think of ways to add spaces left and above, but I think there is probably a module to handle this.
What's the best way to do this?
How would you do it?
Maybe I should use the docx module? I'd rather stick with simple text files if I can.
I think pprint presents text neatly. Can it do simple formatting and write to a text file?
I basically want an indent and some space at the top and/or bottom and some line spacing.
When I batch print the text files I have from a bash terminal, the text is left, no margin, top, no margin.
I can think of ways to add spaces left and above, but I think there is probably a module to handle this.
What's the best way to do this?
How would you do it?
Maybe I should use the docx module? I'd rather stick with simple text files if I can.