sublime text3 下配置python3!


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM