次の2つのリストがあるとします。
column1 = ["Attribute:","Virtual machine:","Troll:"]
column2 = ["A value associated with an object which is referenced by name using dotted expressions. For example, if an object o has an attribute a it would be referenced as o.a.",
"A computer defined entirely in software. Python's virtual machine executes the bytecode emitted by the bytecode compiler.",
"Someone who posts inflammatory, extraneous, or off-topic messages in an online community, such as a forum, chat room, or blog, with the primary intent of provoking readers into an emotional response or of otherwise disrupting normal on-topic discussion."]
このコード:
for c1, c2 in zip(column1, column2):
print "%-16s %s" % (c1, c2)
このテキストを出力します:
Attribute: A value associated with an object which is referenced by name u
sing dotted expressions. For example, if an object o has an attribute a it would
be referenced as o.a.
Virtual machine: A computer defined entirely in software. Python's virtual machi
ne executes the bytecode emitted by the bytecode compiler.
Troll: Someone who posts inflammatory, extraneous, or off-topic messag
es in an online community, such as a forum, chat room, or blog, with the primary
intent of provoking readers into an emotional response or of otherwise disrupti
ng normal on-topic discussion.
私はこれが欲しいですが:
Attribute: A value associated with an object which is referenced by name
using dotted expressions. For example, if an object o has an
attribute a it would be referenced as o.a.
Virtual machine: A computer defined entirely in software. Python's virtual
machine executes the bytecode emitted by the bytecode compiler.
Troll: Someone who posts inflammatory, extraneous, or off-topic
messages in an online community, such as a forum, chat room, or
blog, with the primary intent of provoking readers into an
emotional response or of otherwise disrupting normal on-topic
discussion.
どの端末サイズでもこの結果を得るにはどうすればよいですか?(誰かがクリントがこれを非常に簡単に達成できるかもしれないと私にアドバイスしました、誰かがこれをまだしましたか?)
注:単語が行の終わりまでに細かく切り刻まれないという要件は、私にとって二次的なものにすぎません。最も重要な要件は、リストの各文字列要素を、そのcolumn2
リストの各要素の文字列が開始した場所と同じ水平方向の間隔で継続させることです。