utf-table-generator
ΠΠΎΠ΄ΡΠ»Ρ Π³Π΅Π½Π΅ΡΠΈΡΡΠ΅Ρ ΠΊΠΎΠ΄ Π΄Π»Ρ ΠΏΠ΅ΡΠ°ΡΠΈ Π²ΠΎΡ ΡΠ°ΠΊ ΡΠ°ΠΊΠΈΡ ΡΠ°Π±Π»ΠΈΡ:
ββββββββββ¦ββββββββββββββ¦ββββββββ¦ββββββββββ¦βββββ
β number β float β t β boolean β a β
β βββββββββ¬ββββββββββββββ¬ββββββββ¬ββββββββββ¬βββββ£
β 123 β 12345.456 β test β True β 1 β
ββββββββββ©ββββββββββββββ©ββββββββ©ββββββββββ©βββββ
ΠΠΎΡ ΡΠ°ΠΊ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ:
from utf_table_generator.table import Table
titles = ('number', 'float', 't', 'boolean', 'a')
variables = (123, 12345.4564876435, 'test', True, 1)
t = Table(titles, variables, precision=3) # precision -- ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ Π·Π½Π°ΠΊΠΎΠ² ΠΏΠΎΡΠ»Π΅ Π·Π°ΠΏΡΡΠΎΠΉ, ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ 5
print(t.get_code())
ΠΡΠΈΠΌΠ΅Ρ ΡΠ³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ ΠΊΠΎΠ΄Π°:
print("β" + "β" * 8 + "β¦" + "β" * 13 + "β¦" + "β" * 7 + "β¦" + "β" * 9 + "β¦" + "β" * 4 + "β")
print("β%7s β%12s β%6s β%8s β%3s β" % ("number", "float", "t", "boolean", "a"))
print("β " + "β" * 8 + "β¬" + "β" * 13 + "β¬" + "β" * 7 + "β¬" + "β" * 9 + "β¬" + "β" * 4 + "β£")
print("β%7d β%12.3f β%6s β%8s β%3d β" % ())
print("β" + "β" * 8 + "β©" + "β" * 13 + "β©" + "β" * 7 + "β©" + "β" * 9 + "β©" + "β" * 4 + "β")
ΠΡΠΈΠ½ΠΈΠΌΠ°Π΅ΠΌΡΠ΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: int
, float
, boolean
ΠΈ Π²ΡΠ΅ ΠΎΠ±ΡΠ΅ΠΊΡΡ Ρ ΠΌΠ΅ΡΠΎΠ΄ΠΎΠΌ __str__