Answers for "python how to align text writen to a file"

0

python how to align text writen to a file

file = open(file, "a") 
table_data = [
    ['a', 'b', 'c'],
    ['aaaaaaaaaa', 'b', 'c'], 
    ['a', 'bbbbbbbbbb', 'c']
]
for row in table_data:
    file.write("{: >20} {: >20} {: >20}".format(*row))
Posted by: Guest on November-17-2019

Code answers related to "python how to align text writen to a file"

Python Answers by Framework

Browse Popular Code Answers by Language