VScode是微軟推出的一款輕量級編輯器,功能上和Atom、Sublime Text、Vim類似,可以透過設定將它打造成合適的IDE。
一、軟體下載與安裝
VScode下載網址:https://code.visualstudio.com/
VScode的github專案位址(本文用不到):https://github.com/microsoft/vscode
Python下載網址:https://www.python.org/downloads/
筆者用的是win版的VScode1 .0和32位元Python2.7,安裝Python時注意將Python加入系統環境變數
二、VScode專案結構簡介
VScode使用的是資料夾命名的項目,也就是說你想寫程式的話,需要新建一個資料夾作為你的項目,這個資料夾下放你的來源文件,如果需要運行,還需要在這個資料夾下新建.vscode資料夾,在.vscode資料夾下配置這個項目如何運作。
下面是典型的專案結構
##├─專案名稱│ │ 來源檔案1│ │ 來源檔案2##│ │ 來源檔案2
│ │ ……
│ │ 來源檔案n
│ │
│ └─.vscode
##│ └─.vscode ## #│ settings.json這次配置坑比較多,VScode建議將地區改為en-US,不然的話,有些命令你必須打中文,不能打英文,打中文顯示英文結果,打英文沒有結果。 當然,本文沒改地區三、安裝Python外掛安裝Python外掛程式能實現語法提示的一些功能,建議還是安裝一下。 開啟VScode,查看-->命令面板(Ctrl Shit P),輸入ext install (中文輸入:擴展,然後選擇擴展:安裝擴展),在出現的搜尋結果中選擇找到Python,點右邊的那一朵小雲就可以安裝了。
四、新建專案和編輯原始碼
新建專案就是新建一個資料夾,筆者先在D盤新建一個PythonProject01的資料夾(這一步在系統裡面建,不是VScode裡),點選VScode裡的資源管理器按鈕,點選藍色的開啟資料夾按鈕
在D磁碟找到剛才新建的資料夾,點選選擇資料夾
點選新檔案的按鈕,檔案名稱填hello.py
在右邊的編輯視窗輸入以下程式碼,儲存# -*- coding: UTF-8 -* -print "Hello,World!"print "你好,世界!"五、編輯task.json任務檔案並執行程式查看-->指令面板(Ctrl Shit P),輸入Tasks: Configure Task Runner(中文輸入:任務,然後選擇任務:設定任務執行程式),選擇Other此時VScode會自動產生.vscode資料夾並產生一個預設的task.json將task.json內容改為如下內容並儲存{ // See http:// go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "0.1.0", "command":"python", //"command":"D:\\Python27\\python.exe", "isShellCommand": true, //"args": ["${file}"], //這種寫法不能編譯 "args": ["hello.py"],# "showOutput ": "always"}運行方法如下:檢視-->指令面板(Ctrl Shit P),輸入Tasks: Run Build Task(中文輸入:任務,然後選擇任務:執行生成任務(Ctrl Shit B))結果如下:附:將語言變更為en-USCtrl Shift P,輸入語言(Language),選擇設定語言(Configure Language),會自動出現location.json檔案新增"locale":"en-US",如下所示,儲存{ // 定義VSCode 的顯示語言。 // 請參閱 http://go.microsoft.com/fwlink/?LinkId=761051,以了解支援的語言清單。 // 要更改值需要重新啟動 VSCode。 "locale":"en-US"}重啟VScode即可。 ######如果想改回中文,就改為"locale":"zh-CN"或刪除這個location.json檔案。 ###以上是編輯器vs怎麼樣的詳細內容。更多資訊請關注PHP中文網其他相關文章!

pythonlistscanStoryDatatepe,ArrayModulearRaysStoreOneType,and numpyArraySareSareAraysareSareAraysareSareComputations.1)列出sareversArversAtileButlessMemory-Felide.2)arraymoduleareareMogeMogeNareSaremogeNormogeNoreSoustAta.3)

WhenyouattempttostoreavalueofthewrongdatatypeinaPythonarray,you'llencounteraTypeError.Thisisduetothearraymodule'sstricttypeenforcement,whichrequiresallelementstobeofthesametypeasspecifiedbythetypecode.Forperformancereasons,arraysaremoreefficientthanl

pythonlistsarepartofthestAndArdLibrary,herilearRaysarenot.listsarebuilt-In,多功能,和Rused ForStoringCollections,而EasaraySaraySaraySaraysaraySaraySaraysaraySaraysarrayModuleandleandleandlesscommonlyusedDduetolimitedFunctionalityFunctionalityFunctionality。

ThescriptisrunningwiththewrongPythonversionduetoincorrectdefaultinterpretersettings.Tofixthis:1)CheckthedefaultPythonversionusingpython--versionorpython3--version.2)Usevirtualenvironmentsbycreatingonewithpython3.9-mvenvmyenv,activatingit,andverifying

Pythonarrayssupportvariousoperations:1)Slicingextractssubsets,2)Appending/Extendingaddselements,3)Insertingplaceselementsatspecificpositions,4)Removingdeleteselements,5)Sorting/Reversingchangesorder,and6)Listcomprehensionscreatenewlistsbasedonexistin

NumPyarraysareessentialforapplicationsrequiringefficientnumericalcomputationsanddatamanipulation.Theyarecrucialindatascience,machinelearning,physics,engineering,andfinanceduetotheirabilitytohandlelarge-scaledataefficiently.Forexample,infinancialanaly

useanArray.ArarayoveralistinpythonwhendeAlingwithHomoGeneData,performance-Caliticalcode,orinterfacingwithccode.1)同質性data:arraysSaveMemorywithTypedElements.2)績效code-performance-calitialcode-calliginal-clitical-clitical-calligation-Critical-Code:Arraysofferferbetterperbetterperperformanceformanceformancefornallancefornalumericalical.3)

不,notalllistoperationsareSupportedByArrays,andviceversa.1)arraysdonotsupportdynamicoperationslikeappendorinsertwithoutresizing,wheremactsperformance.2)listssdonotguaranteeconecontanttanttanttanttanttanttanttanttanttimecomplecomecomplecomecomecomecomecomecomplecomectacccesslectaccesslecrectaccesslerikearraysodo。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

SublimeText3 Linux新版
SublimeText3 Linux最新版

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),