- 在Visual Studio Code安裝PYQT Integration的擴充功能
- 安裝PYQT Integration擴充功能後,將會增加下列功能,或更多,例如:
從VS code直接開啟 designer.exe 新增 ui form,在VS Code下預覽 ui form ...

PYQT: New Form Open designer PYQT: Edit In Designer Open designer with current ui form PYQT: Preview Preview current ui form PYQT: Compile Form Compile ui form to path defined in "pyqt-integration.pyuic.compile.filepath" PYQT: Compile Resource Compile qrc file to path defined in "pyqt-integration.pyrcc.compile.filepath" PYQT: Generate Translation File (.ts) Compile UI file (.py) to translation file with path defined in "pyqt-integration.pylupdate.compile.filepath"
Compile .pro filePYQT: Open With Qt Linguist Open with Qt Linguist for translation file (.ts) - 如果從 VS Code,無法正常啟動 designer.exe 或 pyuic5 ...,可以透過擴充延伸模組設定,指定正確的路徑、檔名 ...
- 以Qtdesigner這個設定項目為例,designer.exe,通常都是放在,Anaconda3安裝目錄的\Lib\site-packages\pyqt5_tools\路徑下。
- 設定項目的參考資料:
pyqt-integration.qtdesigner.path Path of executable file of qt designer, the extension will ask you to set at the first time it runs, e.g. c:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\site-packages\\pyqt5-tools\\designer.exe pyqt-integration.pyuic.cmd "pyuic" command, default "pyuic5" pyqt-integration.pyuic.compile.filepath Compile file path, relative path as default, switch to absolute path by involving ${workspace}, e.g. ${workspace}\\UI\\Ui_${ui_name}.py pyqt-integration.pyuic.compile.addOptions Additional options for pyuic compiling, it can be a combination of '-x', '-d', '-i', etc. pyqt-integration.pyrcc.cmd "pyrcc" command, default "pyrcc5" pyqt-integration.pyrcc.compile.filepath Compile file path, relative path as default, switch to absolute path by involving ${workspace}, e.g. ${workspace}\\QRC\\${qrc_name}_rc.py pyqt-integration.pyrcc.compile.addOptions Additional options for pyrcc compiling, it can be a combination of '-root', '-threshold', '-compress', '-no-compress', etc. pyqt-integration.pylupdate.cmd "pylupdate" command, default "pylupdate5" pyqt-integration.pylupdate.compile.filepath Only works when compiling an UI file (.py), Stores the target '.ts' file's path, relative path as default, switch to absolute path by involving ${workspace}, e.g. ${workspace}\\TS\\${ts_name}.ts pyqt-integration.pylupdate.compile.addOptions Additional options for pylupdate, it can be a combination of '-verbose', '-noobsolete', '-tr-function', '-translate-function', etc. pyqt-integration.linguist.cmd "linguist" command, default "linguist"
站內搜尋:Yahoo搜尋的結果,如果沒有給完整的網址,請在站內再搜尋一次!
2019-08-17
讓在Anaconda Navigator環境下安裝執行的Visual Studio Code增加PYQT Integration的擴充功能
讓在Anaconda Navigator環境下安裝的 Visual Studio Code (VS code),以繁體中文的介面顯示
安裝Visual Studio Code (VS Code) 繁體中文語言包(Chinese (Traditional) Language Pack for Visual Studio Code)的步驟:
- 點擊「Extensions」→在Extensions marketplace的搜尋方塊內輸入:chinese language pack,選取「Chinese (Traditional) Language Pack for Visual Studio Code」,可以查看VS Code 的中文(繁體)語言套件的說明擊使用方式。
- 點擊「Install」,安裝後會提示:重新開啟VS Code
- 重新啟動後,就會以繁體中文的語言界面顯示。如果沒有以中文顯示,可以參考以下的使用方式說明:
安裝了之後,在 locale.json 裡面設定 "locale": "zh-tw" 即可載入中文(繁體)的語言套件。要修改locale.json,可以按下Ctrl+Shift+P來呼叫 命令選擇區,輸入 "config" 以從其他可用命令裡面篩選出 Configure Language 命令。
2019-07-31
使用Anaconda Navigator安裝 Python的開發工具VS code
讓Anaconda Navigator來協助開發環境(environment)、模組(package)的管理,是一件愉快的事!
之前已經使用過Jupyter Noteboks、Thonny、Spyder ...等,總有一些功能不能盡如人意,試試VS code,感覺令人滿意。
之前已經使用過Jupyter Noteboks、Thonny、Spyder ...等,總有一些功能不能盡如人意,試試VS code,感覺令人滿意。
- AutoCompletion (IntelliSense ) / 自動補全 / 自動完成 / 輸入提示 ...,例如:
import sys
from PyQt5 import QtWidgets
oApp=QtWidgets.QApplication(sys.argv)
oWidget=QtWidgets.QWidget()
##以上Jupyter Noteboks、Thonny、Spyder 都還可以順利使用 AutoCompletion
oWidget.resize(300,100)
##上面這一行,輸入oWidget. 後,
##Jupyter Noteboks、Thonny、Spyder...
##通通無法帶出提示,知道有多少方法、屬性的選項,
##真的記不了那麼多啦...
##但是 VS code 可以辦到...
- Code Folding / 程式碼折疊
習慣了使用NotePad++的程式碼摺疊功能後,沒有這個功能可以用,會忽然手足無措,尤其是在面對Python用「縮排」的作法取代其他程式語言用 { } 來表示函式、控制敘述...的執行範圍,沒有明顯的 end of def / if / for/ while ... 的標示,程式的辨識很容易混淆,又開始懷念 notepad++ 了 ...
Notepad++ 的 Code Folding / 程式碼折疊
Notepad++ 的 Code Folding / 程式碼折疊
訂閱:
文章 (Atom)
