Basically, I've installed Sublime Text 2 to write in Python.

I then installed Package control and via package control I search "SublimeREPL" and I install the package, however even after installing, when I select Python through Tools > SublimeREPL > Python > Python, I get the error:

WindowsError(2, 'The system cannot find the file specified.')

Any help please? I'm pretty new to this.

有帮助吗?

解决方案

Go to preferences -> Keybindings - User and paste this. Make sure there are only one set of [] in your file, if you have custom keybinds set already then add a , after your last } then paste everything but the [] at the beginning and end after your ,.

[
    { "keys": ["ctrl+shift+r"], "command": "repl_open", 
                 "caption": "Python",
                 "mnemonic": "p",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "cmd": ["python", "-i", "-u","$file"],
                    "cwd": "$file_path",
                    "syntax": "Packages/Python/Python.tmLanguage",
                    "external_id": "python"
                    } 
    }
]

Save and quit Sublime Text.

Follow these instructions How to add to the pythonpath in windows 7?

You should now be able to run your current file in repl with crtl+shift+r

Open sublime text and create a new file. Save it as hello.py

Type:

print('Hello World')

Save then hit ctrl-shift-r

See if that works

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top