欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

個人實踐,如何在vs2017或vs2019中搭建python環境,并與c#混合

系統 2476 0

本來已經安裝了anaconda,不過想更進一步,試試c#與python混合編程。
我記得微軟的vs2017,vs2019已經支持了python,如果能用一個IDE搞定全部,自然是最好的。

首先理解vs2017編譯器是怎么支持python的。

① 按照微軟的說法,Visual Studio 的“Python 環境”窗口(下方為其擴展后的加寬視圖)具有一塊用于管理所有全局 Python 環境、conda 環境和虛擬環境的單獨區域 。 Visual Studio 可自動檢測出標準位置是否安裝 Python,并且允許用戶配置自定義安裝。 在每個環境中,用戶都可以輕松管理包、打開該環境的交互窗口和訪問環境文件夾。

總結-----visual studio能當大管家,電腦里安裝了其他python環境也沒問題。
個人實踐,如何在vs2017或vs2019中搭建python環境,并與c#混合編程(一)_第1張圖片

Use the Open interactive window command to run Python interactively within the context of Visual Studio. Use the Open in PowerShell command to open a separate command window in the folder of the selected environment. From that command window you can run any python script.
For every Python environment known to Visual Studio, you can easily open the same interactive (REPL) environment for a Python interpreter directly within Visual Studio, rather than using a separate command prompt. You can easily switch between environments as well. (To open a separate command prompt, select your desired environment in the Python Environments window, then select the Open in PowerShell command as explained earlier under Support for multiple interpreters.)

使用“ Open interactive window” 命令,在 Visual Studio 的上下文中以交互方式運行 Python。 使用“open PowerShell 中” 命令,在所選環境的文件夾中打開單獨的命令窗口。 可從該命令窗口運行任何 python 腳本。

對于 Visual Studio 已知的每個 Python 環境,用戶都可以直接在 Visual Studio 中輕松打開 Python 解釋器的實時交互 (REPL) 環境,而無需使用單獨的命令提示符。 也可以輕松地切換環境。 (若要打開單獨的命令提示符,請在“Python環境”窗口中選擇所需的環境,然后如之前的對多個解釋器的支持下所述,選擇“在 PowerShell 中打開”命令)
個人實踐,如何在vs2017或vs2019中搭建python環境,并與c#混合編程(一)_第2張圖片

總結-----微軟提供了兩個交互方式,一個叫做interactive window,這是一種實時交互環境,能隨時查看運行結果,變量的值。
另一種叫做 PowerShell 命令行窗口,這是單獨用來執行任何py程序的。

Visual Studio also provides tight integration between the Python code editor and the Interactive window. The Ctrl+Enter keyboard shortcut conveniently sends the current line of code (or code block) in the editor to the Interactive window, then moves to the next line (or block). Ctrl+Enter lets you easily step through code without having to run the debugger. You can also send selected code to the Interactive window with the same keystroke, and easily paste code from the Interactive window into the editor. Together, these capabilities allow you to work out details for a segment of code in the Interactive window and easily save the results in a file in the editor.
Visual Studio also supports IPython/Jupyter in the REPL, including inline plots, .NET, and Windows Presentation Foundation (WPF).

Visual Studio 還緊密集成了 Python 代碼編輯器與Interactive window。 使用 Ctrl +Enter 鍵盤快捷方式可將編輯器中的當前代碼行(或代碼塊)發送給交互 窗口,然后移至下一行(或塊),Ctrl +Enter 無需運行調試程序即可輕松單步執行代碼。 你也可以使用相同的鍵盤快捷方式將選定代碼發送給Interactive window,并輕松地將Interactive window中的代碼粘貼到編輯器中。 將這些功能結合使用可以在Interactive window中找出代碼段的詳細信息,并將結果輕松保存到編輯器的文件中。

總結:Ctrl +Enter功能很牛X。

Visual Studio helps you manage the complexity of a project as it grows over time. A Visual Studio project is much more than a folder structure: it includes an understanding of how different files are used and how they relate to each other. Visual Studio helps you distinguish app code, test code, web pages, JavaScript, build scripts, and so on, which then enable file-appropriate features. A Visual Studio solution, moreover, helps you manage multiple related projects, such as a Python project and a C++ extension project.

Visual Studio 可幫助管理項目隨時間增加的復雜性。 Visual Studio 項目不僅僅是一個文件夾結構:它包括理解不同文件的使用方式以及文件之間的關系。 Visual Studio 可幫助用戶區分應用代碼、測試代碼、網頁、JavaScript 和生成腳本等,從而啟用文件對應的功能。 此外,Visual Studio 解決方案還可以幫助用戶管理多個相關的項目,例如 Python 項目和 C++ 擴展項目。
個人實踐,如何在vs2017或vs2019中搭建python環境,并與c#混合編程(一)_第3張圖片
總結: 發揮ide的優勢,能系統的管理項目,具備很多內置的模板,項目和項模板可自動完成不同類型的項目和文件的設置過程,能為用戶節省寶貴的時間,無需管理錯綜復雜又容易出錯的細枝末節。

⑤司空見慣的智能提示,全面的 Python 調試,使用基于 CPython 的解釋器時,可以在 Visual Studio 中評估 Python 代碼的性能。

以及Linting 檢查,Python 代碼中的錯誤和常見問題,鼓勵使用好的 Python 編碼模式。
為 Python 創建的許多庫都是用 C++ 編寫的,旨在獲得最佳性能。 Visual Studio 提供了豐富的用于開發 C++ 擴展的工具,包括混合模式調試。
總結:所以c++與python在vs中能很好的結合?這個還沒研究過,而linting在anaconda中沒有?

缺點: 因為python通常是一種解釋型語言目前,Visual Studio 本身不提供創建獨立可執行文件的方法,它本質上是一個具有嵌入式 Python 解釋器的程序。另外,Visual Studio 中的 Python 支持不包括用于 UI 開發的任何特定工具。
我記得沒錯的話,python的UI一直是弱項,沒有也無所謂。


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲精品免费网站 | 欧美日批视频 | 日日摸夜夜添免费毛片小说 | 久久一区二区三区免费 | 看中国毛片 | 国产免费又色又爽又黄的网站 | www.日本在线 | 久久精彩免费视频 | 日韩视频在线一区 | 久久精品国产一区二区三区不卡 | 99青青青精品视频在线 | 亚洲国产成人va在线观看网址 | 99在线免费观看 | 首页亚洲国产丝袜长腿综合 | 久草在线首页 | 久草久草视频 | 国产第一页在线视频 | 一区二区蜜桃 | 91免费播放 | av日韩在线看 | 欧美成人手机在线 | 婷婷qvod| 久久成人高清 | 看片国产 | www.伊人 | 91不卡在线 | 亚洲黄色高清视频 | 国产精品久久久久久喷浆 | 日本在线观看免费视频 | 日韩黄色在线视频 | 国产片欧美片亚洲片久久综合 | 91人人看| 国内精品视频 | 国产精品爽爽va在线观看网站 | 狠狠操狠狠操 | 国产精品三级在线播放 | 国产欧美成人 | jjzz日本女人 | 色综合久久天天综合观看 | 97精品久久 | 久草精品免费 |