=============================
Python for Visual Studio Code
=============================

`Visual Studio Code <https://code.visualstudio.com/>`_ (VSC) is a free cross-platform source code
editor. The `Python for Visual Studio Code <http://donjayamanne.github.io/pythonVSCode/>`_
`extension <http://marketplace.visualstudio.com/items?itemName=donjayamanne.python>`_
allows VSC to connect to Python distributions installed on your computer.

If you've installed Anaconda as your default Python installation and installed Python for Visual Studio Code,
your VSC installation is already set to use Anaconda's Python interpreter.


#. Create a new Python source code file:

   #. To choose a directory to place the code, in the **File** menu, select Open. 
   #. In the **File** menu, select New File. Your screen will now look like this:

   .. figure:: /img/anaconda_VSC_newfile.png
      :height: 300px

   |

#. To associate the new file with the Python interpreter, at the bottom of the window, click Plain Text:

   .. figure:: /img/anaconda_VSC_plaintext.png

   |


#. In the menu that displays, type or select Python.

#. In the pane on the right, add source code:



   .. figure:: /img/anaconda_VSC_python.png
      :height: 300px

   |

#. To save the file, in the **File** menu, select Save.

#. To open the Debug pane, click the bug icon.
   Click the gear icon, and then select Python:

   .. figure:: /img/anaconda_VSC_debug1.png
      :height: 300px

   |


#. At the top-right, click the green run arrow next to Python.

   The source code is run using your Anaconda Python interpreter:

   .. figure:: /img/anaconda_VSC_debug2.png
      :height: 300px
