I am making a text adventure and would like the command line window to be a specific size when you run the .py file in the command line window. eg. 300 wide by 250 height. I found a thread on here that shows how to specify the text colour which I also wanted to know. http://www.daniweb.com/forums/post1150939.html#post1150939 Can anybody help? Thanks.
adanaz
0
Newbie Poster
Recommended Answers
Jump to PostMy advice, run it from IDLE and you get an adjustable output window with a nice background that works across several common platforms.
Jump to PostThanks for the advice but I'm trying to make my game retro, like the old text based games such as Zork etc. The green text on a black background is classic.
Honestly, get pygame. Its easy to do a text based game with pygame. It will make a screen, and …
Jump to Postfor the width try
import os os.system("mode con cols=50")
and for the length
os.system("mode con lines=20") #you could also combine them os.system("mode con cols=50 lines=20")
Play around with the numbers until ya find a size you like.
This is windows only.
All 11 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
adanaz
0
Newbie Poster
redyugi
5
Junior Poster in Training
adanaz
0
Newbie Poster
redyugi
5
Junior Poster in Training
Tech B
48
Posting Whiz in Training
adanaz
commented:
This person knows their stuff!
+1
adanaz
0
Newbie Poster
Tech B
48
Posting Whiz in Training
DubWine
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
rproffitt
commented:
+ for Rosettacode. Amazing resource.
+12
DubWine
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.