I am currently working on my School project and in that I created a module that can input a nested list and then converts into a table (or precisely a string that looks like a table).
#Working of program
nested_list = nested_list = [['This', 'is' , 'a' , 'demo'], ['Hello', 'How', 'are'], ['You']]
#Creating table (doc string)
#the program processes the nested list to generate a doc string like the following
table = """
+-------------+-------------+-------------+-------------+
| This | is | a | demo |
+-------------+-------------+-------------+-------------+
| Hello | How | are | - |
+-------------+-------------+-------------+-------------+
| You | - | - | - |
+-------------+-------------+-------------+-------------+ """
#when printed it looks like a table.
The problem is that it works with monospace fonts only and it looks horrible when the string is wrapped. The only way I can fix it is by explicitly configuring the font, height, width and color of font of command prompt window via the program itself.
How can I do that in Python 3.7.4 (version of python I am using currently)?
I am currently using Windows 10 and I have to run the program on Command Prompt(for sure !).