<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Thanks for your reply! But i think using "for@for@for" to find out the appropriate column size is also another waste,</div><div>on the other hand, the length of the list's single string is similar with each other usually, so the maximum maybe is the mode of the list.</div><div><br></div> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">发件人:</span></b> Ian Kelly <ian.g.kelly@gmail.com><br> <b><span style="font-weight: bold;">收件人:</span></b> Tom Zhou <pytom@yahoo.cn> <br><b><span style="font-weight: bold;">抄送:</span></b> "python-list@python.org" <python-list@python.org> <br>
<b><span style="font-weight: bold;">发送日期:</span></b> 2011年12月19日, 星期一, 下午 7:35<br> <b><span style="font-weight: bold;">主题:</span></b> Re: Columnize in module "cmd"<br> </font> <br>On Mon, Dec 19, 2011 at 7:53 PM, Tom Zhou <<a ymailto="mailto:pytom@yahoo.cn" href="mailto:pytom@yahoo.cn">pytom@yahoo.cn</a>> wrote:<br>> Hi~ alls<br>> recently, i focus on the module "cmd", and find some confused things-- the<br>> function named "columnize". Why we need a multiloop as<br>> "for nrows ..<br>> for col ..<br>> for row.."<br>> ?? i think we can make a easier method, for example, first, find out the<br>> maxlen str in list, and use its length as the standard size to format the<br>> list.<br>> Ok, maybe i ignore something, so please give me some hints.<br><br>The columns can have different widths.
Finding the single longest<br>string in the list and using its length for all columns would<br>potentially waste a lot of space.<br><br><br> </div> </div> </div></body></html>