【问题标题】:Can the maximum line width in the terminal be increased in PyCharm?PyCharm可以增加终端的最大线宽吗?
【发布时间】:2020-06-08 00:01:25
【问题描述】:

在 PyCharm 中,终端的最大宽度似乎为 265 个字符。

要查看此内容,请在 PyCharm 终端的 python 提示符下运行以下命令:

print('x' * 264)  # displays a long row of xxxxxxx on one line
print('x' * 265)  # wraps the newline character onto a new line
print('x' * 266)  # wraps one of the x's onto a new line

PyCharm 中是否有设置来增加此线宽限制?

我想打印出比这更长的行,以便与不同程序的输出进行比较。

我意识到我可以从 Python 将输出写入文件,但为了快速调试,打印到终端通常很方便。

【问题讨论】:

  • 这已经被问过了。您确定诸如How do I set the maximum line length in PyCharm? 之类的答案不起作用吗?
  • 我在 stackoverflow 和 google 上都看过,但没有找到其他人问这个问题。您链接到的问题是关于在 editor 中设置线宽,而不是在 terminal 中。

标签: python terminal pycharm


【解决方案1】:

在 PyCharm 中,终端的最大宽度似乎为 265 个字符。

PyCharm 所做的是使用terminal emulator 调用安装在系统上的终端/shell 之一。因此,这些属性对于您配置 IDE 使用的任何终端都是本机的。终端可以选择File>Settings>Tools>Terminal>Application Settings>@987654338 @)。

设置列长度不是 PyCharm 特定的,而是您正在使用的终端/shell/OS 的原生设置。因此,根据您的系统设置此属性会有所不同,在使用 Windows cmd.exe 的示例中,可以使用 Microsoft mode 进行设置,如this post 中所述。屏幕截图显示了问题中的运行示例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-11
    • 2023-02-24
    • 1970-01-01
    • 2019-11-20
    • 2017-01-02
    • 2019-03-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多