.. _open_a_popy_command_prompt: 

Open a |popy| Command Prompt
##############################

To gain access to the :ref:`popy_tools` you need to invoke the |popy| command prompt environment.

There are two main ways of starting a |popy| command prompt:-

* :ref:`desktop_shortcut_method`
* :ref:`command_line_method` 

.. note::

    This assumes that only one version of |popy| is installed on the host machine.
    If there are multiple versions installed, you should check that your 
    |popy| environment is for the correct version by running ``popy info`` 
    before proceeding.

.. _desktop_shortcut_method: 

Desktop Shortcut Method
=========================

Left mouse click on the '|popy| Command Prompt' shortcut on your Desktop or alternatively within the Start Menu (in the |popy| folder). 
This will open a |popy| command prompt in the directory where you installed |popy|.

For example, if you click the |popy| shortcut and installed |popy| to the folder ``c:\PoPy`` you should see something like :numref:`fig_popy_dos_c_popy`:-

.. _fig_popy_dos_c_popy:

.. figure:: dos_c_popy.png
    :width: 50%
    :align: center
    
    |popy| dos prompt
    
You can then ``cd`` into your working folder and begin using |popy| from there.


.. _command_line_method:

Console Method
==========================

Open a command prompt or Powershell in **any** folder on your computer in three steps:-

* navigate to the folder in Windows Explorer
* left mouse click on the path editbox directly below the menus
* type ``cmd`` for a traditional Command Prompt (or ``powershell`` for a Powershell) and press return

For example if you navigate to the directory in Windows Explorer:-

.. code-block::

    c:\Users\david\

Then type ``cmd`` over the Windows Explorer path, a regular Command Prompt should appear like this :numref:`fig_plain_dos_prompt`:-

.. _fig_plain_dos_prompt:

.. figure:: dos_plain.png
    :width: 50%
    :align: center
    
    Plain command prompt
    
Then type:-

.. code-block:: console

    popy
    
You should see something like:-

.. literalinclude:: popy_help.inc
    :language: console
    
(Note the colour of the window text will change from white to pale blue, and the window background will become black even for a Powershell.)

.. note::

    There _should_ be no significant difference between running |popy| in 
    a Command Prompt versus running it in a Powershell.
    We have, however, seen examples where running in a Command Prompt took significantly longer than in a Powershell for
    reasons we have not yet understood.

Verify |popy| Environment
=========================
    
The light blue text signifies that you are within a |popy| environment. You can verify this further by running :ref:`popy_info`:-

.. code-block:: console

    $ popy info
    
You should now be able to run all the :ref:`popy_tools`.
