【问题标题】:Running a python script in notepad ++ doesn't work and other posts doesn't work在记事本++中运行python脚本不起作用,其他帖子也不起作用
【发布时间】:2018-10-12 20:08:50
【问题描述】:

最近,(半小时前)我下载了 Notepad++ 来编码而不是 IDLE。

只是为了看看是否一切正常,我创建了这个简单的程序来测试

def test():
    print("hello")

test()

我运行它,然后一个窗口立即打开并关闭。

假设我遇到的问题的答案位于此处:How to Execute a Python File in Notepad ++? 我按照说明进行操作,我尝试过,但没有成功。然后我用 shift-RBM 复制文件路径而不是页面上的内容,但仍然像以前一样出现错误消息:

The system cannot find the file specified.
An attempt was made to execute the below command.
-------------------------------------------------
Command: C:\Users\----\Desktop\Python
Arguments: 3.5\Python 3.5 (32-bit).Ink
"C:\Users\----\Desktop\test.py" -i
Error Code: 2
-------------------------------------------------

在这之后,我来到这里并问了这个问题。对不起,如果答案在别处或显而易见。

【问题讨论】:

    标签: python notepad++ python-3.5


    【解决方案1】:

    您的某些文件夹名称中似乎有空格。

    要解决此问题,您需要在 python 路径之前和之后使用 "

    例子:

    "C:\Users\----\Desktop\Python 3.5\Python 3.5 (32-bit).Ink" "C:\Users\----\Desktop\test.py" -i
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-07
      • 2018-02-15
      • 2018-12-21
      • 1970-01-01
      • 2020-11-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多