(I couldn't think of a better name)
A module to generate text-based tables and save them to a text file.
Create a table object;
example = table()
Table columns can be set at any time, even if there's already rows present.
Set its columns;
example.setColumns("1", "2", "3", "4")
Table rows can be added at any time. If a row contains more items than there are columns, the extra items will not show up when saving the table.
Add rows;
example.addRow("a", "b", "c", "d")
example.addRow("green", "blue", "yellow", "red")
Sort the table by the specified column, either ascending or descending. Default is descending.
example.sort("1")
#or
example.sort("1", ascending=False)
Ascending;
example.sort("1", ascending=True)
Once you finish adding columns and rows to the table, you can save it to file.
Save table to "example.txt". Will create a file if it doesn't exist, otherwise returns an error.
example.save("example.txt")
#or;
example.save("example.txt", fileMode="x")
Append table to "example.txt";
example.save("example.txt", fileMode="a")
Save table to "example.txt", and overwrite it if it already exists;
example.save("example.txt", fileMode="w")