简体   繁体   English

如何使用 python 制作一个 800x800 的控制台窗口

[英]How do I make a 800x800 console window with python

我最近在 python 3.9 中制作了一个简单的基于文本的游戏,我想这样做,所以当你运行 .exe 时,它​​会打开一个 800x800 或我想放入的任何比例的控制台窗口。谁能帮我做这个请!

The only option that i can think of its to run tour program in PowerShell , this one can resize it self with something like this我能想到的在PowerShell 中运行游览程序的唯一选择,这个可以用这样的东西来调整它的大小

$pshost = get-host
$pswindow = $pshost.ui.rawui
$newsize = $pswindow.buffersize
$newsize.height = 3000
$newsize.width = 150
$pswindow.buffersize = $newsize
$newsize = $pswindow.windowsize
$newsize.height = 50
$newsize.width = 150
$pswindow.windowsize = $newsize

I get this code from here我从这里得到这个代码

You can call this commands inside python with OS module.您可以使用OS模块在 python 中调用此命令。

I couldnt test the code cause #teamLinux .我无法测试代码原因#teamLinux

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将我的 800x480 5 英寸屏幕分成两部分 - How do I split my 800x480 5-inch screen into 2 parts python线程不能创建超过800个 - python thread cannot create more than 800 如何将 python 控制台应用程序 window 居中? - How do I center a python console app window? Python - 通过解包以太网帧获取 0xc0a8 类型期望 0x800 不期望数据 - Python - Not Expecting Data by Unpacking Ethernet Frame Getting 0xc0a8 on Type Expecting 0x800 如何获取控制台window的内容? (Python) - How do I get the contents of the console window? (Python) 如何使用光栅将光栅图像 (TIFF) 大小调整为 800x600? - How to resize a raster image (TIFF) to 800x600 using rasterio? 在 Python 中使用 Raspberry Pi 将图像发送到 QL-800 打印机时如何解码此错误? - How to decode this error when using Raspberry Pi to send an image to a QL-800 printer in Python? 数组是(800,)尺寸,每个元素是(240,)尺寸,如何更改为(800,240) - array is (800, ) dimension, each element is (240, ) dimension, how to change to (800, 240) 验证码产生错误InteropServices.COMException(0x800A03EC):来自HRESULT的异常:0x800A03EC - Validation code produces error InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC 如何更改Windows控制台窗口上X按钮的功能? - How do I change what the X button does on the Windows console window?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM