Modify font size when print out to screen

2019-02-27 11:46发布

I'm using Win XP and Python 2.5. Is there a way in Python to modify font size when print to CMD window?

3条回答
小情绪 Triste *
2楼-- · 2019-02-27 12:01

You should create a desktop link to cmd.exe and set/change the layout properties (e.g. to window size 120*40 or appropriate). Start your program in this console windows (python.exe yourprogram.py).

查看更多
Fickle 薄情
3楼-- · 2019-02-27 12:03

You can use ctypes to access the necessary windows calls to change the font (including the size of the font) of the console. See my answer to another question for a code example.

查看更多
混吃等死
4楼-- · 2019-02-27 12:15

No, you can't change that, as far as I know. Luckly, nobody on windows uses the console anyway, so I advise you to move to a GUI library instead.

With your own GUI window, you can configure the font and layout as much as you want, include buttons, images, animations, menus, etc...

查看更多
登录 后发表回答