I am working on a little text based console game using Python. Because I am using some ASCII art I have to ensure that the width of the console is the same for everyone after launch of my game. Can anyone tell me how to set the console width and height ? :)
Greetz
Flo
a) To check the size of the Terminal Window
import os
x = os.get_terminal_size().lines
y = os.get_terminal_size().columns
print(x)
print(y)
b) To change the size of the Terminal Window
import os
cmd = 'mode 50,20'
os.system(cmd)
c) To change the color of the Terminal Window
import os
cmd = 'color 5E'
os.system(cmd)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With