3

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.

2
  • Does pygame run on WIndows? I'm not sure, but you might look into that. Commented Nov 11, 2012 at 1:37
  • The conque module conque_sole_subprocess is an example of using ctypes to launch and control a win32 console process, including resizing the buffer/window. It would be a bit simpler in your case since you're not creating a hidden console and mirroring its content through shared memory, but still not trivial at all. It would be simpler to just use pygame, as Keith suggests. Commented Nov 11, 2012 at 8:26

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.