<type>documentation</type>
<domain>debug</domain>
<id>quick-start</id>
<title>Debugger Quick Start</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>per+</product>

**Overview of Capabilities**

Wing can be used to debug all sorts of Python code, including desktop applications, web
applications, numeric and scientific applications, games, and many others. Code that Wing debugs may
be launched from the IDE, or started outside of the IDE. It may be running stand-alone on the local
host or launched from a web server or web framework. Wing Pro can also debug code running on a
remote host, virtual machine or device, in an application that uses Python as a scripting language,
or inside a container like those provided by Docker. The debugger can work with asynchronous and
multi-threaded code and (in Wing Pro) multiple concurrent processes.

~~~if WINGPRO:
Wing Pro includes support for many different packages and frameworks, including `wxPython
<ref:howtos/wxpython>`__, Tkinter, `PyQt <ref:howtos/pyqt>`__, `PyGObject <ref:howtos/pygobject>`__,
`matplotlib <ref:howtos/matplotlib>`__, `Jupyter <ref:howtos/jupyter>`__ `pygame
<ref:howtos/pygame>`__, `Django <ref:howtos/django>`__, `Flask <ref:howtos/flask>`__, `Pyramid
<ref:howtos/pyramid>`__, `mod_wsgi <ref:howtos/mod_wsgi>`__, `Plone <ref:howtos/plone>`__ and many
others. Wing can also work with code running in an embedded Python interpreter in the context of a
larger application such as `Blender <ref:howtos/blender>`__, `Maya <ref:howtos/maya>`__, `Nuke
<ref:howtos/nuke>`__, and `Source Filmmaker <ref:howtos/sfm>`__.
~~~

While Wing is capable of debugging Python code in many development scenarios, this Quick Start guide
focuses on the case where you are working with locally stored code that is launched from the IDE. If
you need to launch code from outside of the IDE, on a remote host, virtual machine or device, or on
a container like those supported by Docker, please see `this overview <ref:debug/index>`__.

**Getting Started**

Before debugging, you will need to install Python on your system if you have not already done so.
Python is available from `python.org <https://python.org/>`__ or you can use a distribution like
`Anaconda <https://anaconda.com>`__.

To start debugging some Python code, open up the file in the editor and then select
``Start / Continue`` from the ``Debug`` menu. This will run to the first breakpoint,
unhandled exception, or until the debug program completes. Select ``Step Into`` instead to
run to the first line of code.  For details see `Starting Debug <ref:debug/starting-debug>`__.

To set breakpoints, just click on the left-most margin next to the source code in the editor. In
Wing Pro, conditional and ignore-counted breakpoints are also available from the ``Breakpoint
Options`` group in the ``Debug`` menu, or by right-clicking on the breakpoints margin. For details,
see `Setting Breakpoints <ref:debug/setting-breakpoints>`__.

You can step through code with the items in the ``Debug`` menu or from the toolbar.  For
details see `Flow Control <ref:debug/flow-control>`__.

To view debug data you can hover your mouse over a value in the editor or use the ``Stack Data``
tool from the ``Tools`` menu to inspect locals and globals. In Wing Pro, you can also interact with
the current debug stack frame and try out new code in the ``Debug Console`` from the ``Tools`` menu, or press
``Shift-Space`` to view all visible values in the editor. For details see `Viewing Debug Data
<ref:debug/viewing-data>`__ and `Interactive Debug Console <ref:debug/debug-console>`__.

Use the `Debug I/O <ref:debug/debug-process-i-o>`__ tool to view your program's output, or
to enter values for input to the program you are debugging. If your program depends on
characteristics of the Windows Console or a particular Linux/Unix shell, see `External I/O
Consoles <ref:debug/external-i-o-consoles>`__ for more information.

In some cases, you may need to specify a ``Python Executable``, ``Python Path`` or other
environment using `Project Properties <script:view_project_properties>`__ in the
``Project`` menu. Setting the ``Python Executable`` is only necessary if Wing cannot find
Python on your system or if you have more than one version of Python installed. Command
line arguments to use when debugging a file may be set in `File Properties
<ref:proj/file-properties>`__ for the file. See `Debug Environment
<ref:debug/debug-properties>`__ for more options.

There are many other capabilities available in the debugger, as described in the
rest of this chapter and `Advanced Debugging Topics <ref:debug/advanced>`__.
