Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locking terminal size in python?

I'm wondering if there is any python code I can use to lock the size of my CMD window? I'm making a small text adventure game and want t at a specific size.

If it helps, I'm using windows 7, but wouldn't mind mac and linux compatible instructions. Thanks.

like image 485
Sato Avatar asked Aug 12 '26 01:08

Sato


2 Answers

I don't think this is possible. If you want to control a gui directly, you should use a gui package like tkinter for example

from Tkinter import *
window = Tk()
window.minsize(minw, minh)
window.maxsize(maxw, maxh)

add a text block to this and treat it just like a cmd window. You can read more about it on the Tkinter docs

like image 155
ceptno Avatar answered Aug 14 '26 13:08

ceptno


you can use pyWinGUI for emulate text terminal with comctl.Edit control

like image 29
maxim Avatar answered Aug 14 '26 13:08

maxim