Strange tab problem!

mackstann mack at incise.org
Mon Aug 25 05:28:43 CEST 2003


On Sun, Aug 24, 2003 at 11:17:59PM -0400, tjland at iserv.net wrote:
> Okay i wrote a small program that allows users to creat book listings
> featuring copyright date author and title. Now when i display the book
> listings i get this.
> 
> Book:  testover6  	Author:  ???  	Copyright: 2003
> Book:  testu6  	Author:  ???  	Copyright: 2003
> 
> Okay now after the book title their is supposed to a tab the coding goes
> like this.
> 
> for x in title_author.keys():
>         print "Book: ",x," \tAuthor: ",title_author[x],"
> \tCopyright:",title_copyright[x]
> 
> it seems that whenever i go over six characters it adds another tab. Is
> there a preset field limit to six bytes. What is happening? Thanx in
> advance.

The way that tabs are displayed are really dependent on the software
displaying them, if you want to have strict column-like layout, you
could calculate the longest item in a given column, and then use
item.ljust(length_of_longest_item_in_column).

-- 
m a c k s t a n n  mack @ incise.org  http://incise.org
Real Programs don't use shared text.  Otherwise, how can they use
functions for scratch space after they are finished calling them?





More information about the Python-list mailing list