I have text file like this:
A fistful of Dolars|Western|100|Sergio Leone|Clint Eastwood|Italia|1964
For a few dolars more|Western|130|Sergio Leone|Clint Eastwood|Italia|1965
The Good, the Bad and the Ugly|Western|179|Sergio Leone|Clint Eastwood|Italia|1966
And I try it to format on this way:
def movie_list():
movies = open('movies.txt','r').readlines()
for i in movies:
movie = i.strip("\n").split("|")
for args in (('Name','Genre','Running time', 'Director', 'Starring', 'Country', 'Released'),(movie[0], movie[1], movie[2], movie[3], movie[4], movie[5], movie[6]+"\n")):
print (('{0:<13} {1:<10} {2:<10} {3:<13} {4:<13} {5:<8} {6:<4}').format(*args))
And on few similar ways...
How to set size of row depending of length of string for each line in text file (i.e. movie)
(I did it in paint :D) The best way is to look like this: