【问题标题】:Is there any function which clears pycharm output screen? [duplicate]是否有任何清除pycharm输出屏幕的功能? [复制]
【发布时间】:2020-03-22 12:13:08
【问题描述】:

os.system('cls') 不起作用。它只是简单地在输出的末尾放置一个方框

【问题讨论】:

  • @Klaus D 我以前见过这个问题。尽管在使用 pyautogui 回答该问题时提到了解决方法。我想知道方法是否存在。也许存在一个我不知道的 pycharm 控制台库
  • 库请求在 Stack Overflow 上是题外话。
  • @Klaus D 好吧,我不知道

标签: python pycharm


【解决方案1】:

如果您查看os.system 函数的文档,它会显示execute the command in a subshell

def system(*args, **kwargs): # real signature unknown
    """ Execute the command in a subshell. """
    pass

这意味着,您的主控制台正在接收在子控制台 ada 中运行的 cls 命令的输出

【讨论】:

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