【问题标题】:Python 2.7 lost scroll bar after using os.system("mode con: cols=80 lines=45")Python 2.7 在使用 os.system("mode con: cols=80 lines=45") 后丢失了滚动条
【发布时间】:2014-01-27 22:21:26
【问题描述】:

正如标题所示,我使用 os.system("mode con: cols=80 lines=45") 来更改控制台窗口的大小,但随后我失去了滚动条的权限,这意味着如果我打印一次输出超过 45 行,我无法滚动回顶部。有没有办法在不失去滚动条特权的情况下重新调整窗口大小?

我还应该提到我使用的是 Windows 8

【问题讨论】:

  • 你用的是什么操作系统?
  • 我应该提到这一点,抱歉。我正在使用 Windows 8

标签: python console resize window


【解决方案1】:

不幸的是,mode con 总是将控制台缓冲区大小设置为与指定的行数相同,这就是您看不到滚动条的原因。您可能会更幸运地采用此处详述的较低级别的方法:

How to control the size of the Windows shell window from within a python script?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-10
    • 1970-01-01
    • 2012-10-03
    • 1970-01-01
    • 2017-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多