=============================
Getting started with Anaconda
=============================

Anaconda Distribution contains **conda** and **Anaconda Navigator**, as well as Python and
hundreds of scientific :doc:`packages <../packages/index>`.
When you installed Anaconda, you installed all these too. You can try both conda
and Navigator to see which is right for you to manage your packages and environments.
You can even switch between them, and the work you do with one can be viewed in the other.

Now, try this simple programming exercise two ways, with Navigator and a terminal, to
help you decide which approach is right for you.

Your first Python program: Hello, Anaconda!
===========================================

Write and run a Python program using Anaconda Navigator.

1. Open Navigator
-----------------

**Windows**

From the Start menu, click the Anaconda Navigator desktop app.

   .. figure:: /img/navigator-anaconda-prompt.png
      :width: 50%

**MacOS**

Open Launchpad, then click the Anaconda-Navigator icon.

**Linux**

Open a Terminal window and type anaconda-navigator.


2. Run Python in Spyder IDE (integrated development environment)
----------------------------------------------------------------

TIP: Navigator's Home screen displays several applications for you to
choose from. For more information, see links at bottom of this page.

On Navigator's Home tab, in the Applications pane on the right, scroll
to the Spyder tile and click the Install button to install Spyder.

NOTE: If you already have Spyder installed, you can jump right to the Launch step.

Launch Spyder by clicking Spyder's Launch button.

In the new file on the left, delete any placeholder text, then type or
copy/paste ``print("Hello Anaconda")``.

In the top menu, click File - Save As and name your new program ``hello.py``.

Run your new program by clicking the triangle Run button.

You can see your program's output in the bottom right Console pane.

3. Close Spyder
---------------

From Spyder's top menu bar, select Spyder - Quit Spyder (In macOS,
select Python - Quit Spyder).

4. Close Navigator
------------------

From Navigator's top menu bar, select Anaconda Navigator - Quit
Anaconda-Navigator.


Write a Python program using Anaconda Prompt or Terminal
========================================================

1. Open Anaconda Prompt
-----------------------

**Windows**

From the Start menu, search for and open "Anaconda Prompt":

.. figure:: /img/anaconda-prompt.png
   :width: 50%

   ..

|


**MacOS**

Open Launchpad, then click the Terminal icon.

**Linux**

Open a Terminal window.

2. Start Python
---------------

At Anaconda Prompt (Terminal on Linux or macOS), type ``python`` and press Enter.

The ``>>>`` means you are in Python.


3. Write a Python program
-------------------------

At the ``>>>``, type ``print("Hello Anaconda!")`` and press Enter.

When you press enter, your program runs. The words "Hello Anaconda!" print to
the screen. You're programming in Python!

4. Exit Python
--------------

On Windows press CTRL-Z and press Enter. On macOS or Linux type
exit() and press Enter.

What's next?
============

Using Navigator
---------------

* `Getting started with Navigator (10 minutes) <https://docs.anaconda.com/anaconda/navigator/getting-started>`_
* `Navigator user guide <https://docs.anaconda.com/anaconda/navigator/>`_

Using conda
-----------

* `Getting started with conda (20 minutes) <https://conda.io/docs/user-guide/getting-started.html>`_
* `Conda cheat sheet (pdf) <https://conda.io/docs/_downloads/conda-cheatsheet.pdf>`_
* `Conda user guide <https://conda.io/docs/user-guide/index.html>`_

Links to IDE documentation
--------------------------

 * :doc:`tasks/integration/eclipse-pydev`
 * :doc:`tasks/integration/idle`
 * :doc:`tasks/integration/sublime`
 * :doc:`tasks/integration/ninja`
 * :doc:`tasks/integration/pycharm`
 * :doc:`tasks/integration/python-ptvs`
 * :doc:`tasks/integration/python-vsc`
 * :doc:`tasks/integration/spyder`
 * :doc:`tasks/integration/wing`
 * :doc:`tasks/integration/intellij`
