Код: Выделить всё
import tabulate # pip install tabulate
def format_text(x, y):
return "{:5.1f} -> {:5.1f}".format(x, y)
table_entries = [[format_text(-0.3, 0.3), 0.3], [format_text(0.5, -0.5), 0.5]]
table_headers = ["X", "Y"]
tabulate.PRESERVE_WHITESPACE = False
print(tabulate.tabulate(table_entries, headers=table_headers, disable_numparse=True))
print()
tabulate.PRESERVE_WHITESPACE = True
print(tabulate.tabulate(table_entries, headers=table_headers, disable_numparse=True))
Код: Выделить всё
X Y
------------- ---
-0.3 -> 0.3 0.3
0.5 -> -0.5 0.5
X Y
-------------- ---
-0.3 -> 0.3 0.3
0.5 -> -0.5 0.5
Код: Выделить всё
X Y
------------- ---
-0.3 -> 0.3 0.3
0.5 -> -0.5 0.5
X Y
------------- ---
-0.3 -> 0.3 0.3
0.5 -> -0.5 0.5
// Насколько я помню, несколько месяцев он работал нормально, но недавно сломался.
Консоль действий Github: https://github.com/w3ntao/debug-space/a ... 6028464147
Подробнее здесь: https://stackoverflow.com/questions/799 ... -action-vm
Мобильная версия