Running python in Sublime Text 2 getting error

前端 未结 2 1042
小鲜肉
小鲜肉 2021-01-20 22:46

so I have recently gotten into python and I use sublime text 2 alot for things like HTML and CSS and I want to use it for python too but when i try to compile with it I get the

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 23:34

    It happens for the reason that the cmd starts at "C:\Users\YOU". You have to "say" the complete path. I send the args "-u" and the my file's url directly to the python.exe.

    Try it:

    {
    "cmd": ["C:\\Python27\\python.exe", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
    }
    

    Obs: I'm using Python 2.7 and its executable file is in C:\Python27\ folder.

提交回复
热议问题