我以为我可以在几分钟内把东西拼凑在一起,但将文本格式化为列比我想象的要困难得多。但是这里是我到目前为止,仍然相当越野车...
class format_lines(object):
"""
1) some text goes 2nd column of text
here. But not its not really that
all text goes hard to add more text
in this column in a given format
2) another point
for text
"""
def __init__(self, *args, **kargs):
self.max_char_width = 30
self.gutter_width = 15
self.gutter = ' '*self.gutter_width
self.previous_line1 = None
self.previous_line2 = None
self.p1_index = 0
self.p2_index = 0
print args
print "len args = ", len(args)
if len(args) == 2:
print "Starting the test"
self.print_lines_(args[0], args[1])
def print_lines_(self, p1, p2):
while self.p1_ind