Hướng dẫn python print tab align
Resurrecting another topic, but this may come in handy for some. With a little bit of inspiration from https://pyformat.info you can build a method to get a Table of Content [TOC] style printout.
The resulting output is as follows:
Python offers several ways of formatting and doing tricks like adding colors to the output and aligning the text in columns - left or right. Below you can see simple example before and after formating and the big difference in the output: There many ways to add color in python:
The format is the following:
If you skip the color end all the rest of your prints will be in the same color. The same for text align you have several option:
In the example below I'm using colorama and formatting:
result(this is shown without the colors:
The final outlook is like in this picture: |