sublime text3 下配置python3!
阿新 • • 發佈:2019-01-12
1.下載sublime3和python3(在騰訊軟體中心下載較快)
2.安裝
3.開啟sublime ,tools->build system->new build system,在檔案中寫入:
{ "encoding": "utf-8", "working_dir": "$file_path", "shell_cmd": "C:\\python36\\python.exe -u \"$file\"", "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" }
shell_cmd是python的安裝路徑,注意按照格式來,然後ctrl+s,儲存檔案,去取名為python3.6
4.點選build system 可以看到python3.6,選擇它,然後新建一個檔案,ctrl+s把檔案命名為hello.py,在檔案輸入程式碼:
print('hello world!')
然後ctrl+b執行,正常執行,至此第一步大功告成!
5.但是這樣的是沒有互動功能的,比如出現提示輸入,然後鍵盤輸入一個數,目前這個配置是無法做到的,我們要安裝一個外掛
6.選擇tools->install package control,等待安裝成功
7.在pereference可以看到package control,然後點選package control,在搜尋框輸入install package
8.可能出現問題:https://www.jianshu.com/p/ceb68e69f1ad
9.搜尋sublimeREPL
10.key blindings繫結F5
{ "keys":["f5"], "caption": "SublimeREPL: Python - RUN current file", "command": "run_existing_window_command", "args": {"id": "repl_python_run", "file": "config/Python/Main.sublime-menu"} }
11.程式碼補全外掛:sublimecodeINTEL