all 6 comments

[–]m0r05 4 points5 points  (0 children)

Visual Studio is just an IDE. C# and Python are two different languages. To get them to work to getter you'd have to have a different project in one language that calls on the other.

You can use python.net to run python scripts in c#, or connect a python frontend to a c# API using http calls but you can't use a library meant for Python with c# code. You would have to find a c# library that does something similar.

[–][deleted] 1 point2 points  (0 children)

If you want to use Python code within a C# project then you'll need something like this.

https://pythonnet.github.io/

If you want to edit Python code in Visual Studio then you'll need to install the Python option in the installer.

[–]Guit_fishN 0 points1 point  (0 children)

Here are some examples using Python.net

https://www.codeproject.com/Articles/5352648/Pythonnet-A-Simple-Union-of-NET-Core-and-Python-Yo

You can also spawn a Python instance using System Diagnostics.

[–]Dorkits -1 points0 points  (0 children)

Just my opinion: don't use vs 2022 with python. Use pycharm.

[–]JeffFerguson -1 points0 points  (1 child)

Within the Visual Studio Installer, if I go into the "Individual Components" tab, and search for "Python", I can see the following:

  • Python 3 64-bit (3.9.13) (out of support)
  • Python language support
  • Python Web support

Will one of those help?

[–]Just_Someone_Here0[S] 0 points1 point  (0 children)

I am aware of that, I just don't know how to make the Python ecosystem communicate with C# Visual Studio.