(Jun-30-2018, 03:56 PM)ichabod801 Wrote: I've done this a few times. Get the string output as a list of lists. For each index in the sub-lists, get maximum width. Construct a format string with those widths and the justifications you want. Apply the rows to that format string repeatedly, printing or joining with '\n'.BTDT2
just did one today which is why i was thinking or hoping something making this easy would be nice if it existed. you just print via a method of this class, giving each column as an argument. it would save the data and accumulate the max width of each column. once done a final method is called, then it actually prints the saved data, formatting each column to the max width or a specified width. it will also remember if a column is entirely numeric and right-justify if so, else left-justify, unless the justification is specified.
i didn't see any documentation for tabulate. where does that come from?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.