Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically Resize Command Line Window

I'm writing a program in Python, the data I want it to show must be able to fit on the screen at the same time without needing to scroll around. The default command line size does not allow for this.

Is there any way to automatically resize a command line window in Python without creating a GUI? The program will only be used on windows.

like image 410
Dan Doe Avatar asked Feb 27 '12 01:02

Dan Doe


1 Answers

import os

os.system('mode con: cols=100 lines=40')
raw_input("Press any key to continue...")
like image 164
Fahri Güreşçi Avatar answered Sep 19 '22 19:09

Fahri Güreşçi