Sublime Text 3 打造舒服的工具(直接運行python)__python

來源:互聯網
上載者:User

1:Package Contro

l按 ctrl+`(數字1左邊的、tab鍵上邊的那個),然後輸入一下代碼,斷行符號:

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
重啟Sublime Text。

        在之後的安裝中,按Ctrl+Shift+P開啟命令列模式,輸入Install Package關鍵字,然後點擊自動出現的下拉式功能表裡的第一項:Package Control: Install Package。

2. ConvertToUTF8

解決中文亂碼問題。

安裝好之後出現的頁面:即ConvertToUTF8的介紹 3.SublimeREPL


這段代碼在 sublime中沒辦法進行互動輸入

會報錯:

Traceback (most recent call last):a = raw_input()
EOFError: EOF when reading a line

這讓人確是不爽。。。

解決方案:
首先安裝sublimeREPL外掛程式

然後

preferences > Key Buildings - user  中插入如下代碼

    { "keys": ["alt+q"], "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"                 }     }


然後ALT + q 就可以運行了。。。



4.Xdebug

當開始編程一段時間的時候就會迫切的需要調試的技巧了,那麼在Sublime 中使用的基本是Xdebug

首先安裝Xdebug 搜尋到之後,安裝就好了


然後就可以按照他的按鍵提示進行調試了









  未完待續。。


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.