【问题标题】:running python program in IDLE在 IDLE 中运行 python 程序
【发布时间】:2015-11-15 01:15:04
【问题描述】:

我想将我的代码从我的文本编辑器粘贴到 IDLE 窗口中,但是当我这样做时,程序将无法运行。有没有办法在不复制和粘贴到空闲窗口的情况下运行我的程序。 (我是一个完整的 NOOB)

【问题讨论】:

  • 粘贴程序时是否考虑了缩进? Python 需要正确的缩进!
  • 我相信 IDLE 上有一个按钮,上面写着“运行”。它会运行你的程序。

标签: python python-idle


【解决方案1】:

要在 IDLE 中运行 Python 3 程序,从命令行:

$ python3 -m idlelib -r your_script.py

对于早期的 Python 版本,请参阅How to start IDLE (Python editor) without using the shortcut on Windows Vista?

【讨论】:

    猜你喜欢
    • 2011-02-25
    • 1970-01-01
    • 2021-11-21
    • 1970-01-01
    • 2021-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-28
    相关资源
    最近更新 更多