代码之家  ›  专栏  ›  技术社区  ›  Bill Wang theNoble247

在python中不确认退出命令[已关闭]

  •  -3
  • Bill Wang theNoble247  · 技术社区  · 9 年前

    在Python中,如果 exit() 命令,它将在退出前确认。我不喜欢每次都点击退出按钮的想法。有没有办法绕过这个确认?(这是使用IDLE外壳)

    1 回复  |  直到 9 年前
        1
  •  0
  •   wgwz    9 年前

    Ctrl+d是退出python解释器的快捷方式。这适用于IDLE和交互式Python shell(linux、windows或osx)。在IPython shell中,您将被要求[y/n]确认退出。