Visual Studio/Python
Since Visual Studio 2010, VS has support for debugging and running Python applications.
Notes
[edit | edit source]Python is an interpreter, not a compiler. This means that, barring syntax errors, the code is executed at runtime. Hence Visual Studio (and others) have weak IntelliSense support.
Installation
[edit | edit source]Follow the instructions here. In particular, while you can use Visual Studio 2017's installer to install Python, this isn't needed and Python can be installed otherwise. The same applies if you want to use alternative Python distributions like Anaconda-Python.
Usage
[edit | edit source]Once you've installed it, a new project can be created by Python -> Python Application or from the option "From Existing Python Code". Running the Python code will open a command window where the code is run, and one can set breakpoints like any other program.
Hint: Visual Studio requires a project file to be created for Python. However, this does not mean that you cannot use other programs at the same time. For example, if you are using Spyder, then simply open the main .py file from there; VS does not add any extra information to it. |