# CISCO DevNet - Coding & API's

## Setting Up Dev Workstation - Windows Setup:

### GIT and git-bash

* Install GIT on Windows Laptop
  * Navigate and [download ](https://git-scm.com/downloads)GIT to your computer
  * Click on the "Windows" icon and once downloaded, install using default and with the following considerations.
    * Consider checking the box to add "Additional Icons > On the Desktop"
    * Consider changing the default text editor for Git to another option, if you have one available. For example, Notepad++
  * **Open `git-bash` using Desktop or Start menu** shortcut and verify all is working OK
    * run the following commands to test
      * `git --version`
      * `git clone https://github.com/CiscoDevNet/hello_network`

![](https://4011257951-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtfmTuncdFr6DnNyt_b%2F-MUoUsYIi5wVNygJkMKF%2F-MUsZAlqXEGkmEOay1Gf%2Fimage.png?alt=media\&token=7400a0c5-b6c9-4bc0-8c6b-8ededc833dc8)

### Terminals and Shells

The git-bash shell interpreter for Windows was installed along as part of the git install done previously. Lets run a script:

`cd /hello_network`\
`./network.sh`\
`Hello World!`

![](https://4011257951-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtfmTuncdFr6DnNyt_b%2F-MUoUsYIi5wVNygJkMKF%2F-MUsf2Rwxfntxtb5nU5q%2Fimage.png?alt=media\&token=57343a4e-4517-4c91-9706-5400af5bc37b)

### Python and Nodejs

* &#x20;Navigate to [www.python.org/downloads/windows/](https://www.python.org/downloads/windows/).
* Click the link "Latest Python 3 Release and install
* Remember to "tick" the **Add Python to PATH** box

![](https://4011257951-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtfmTuncdFr6DnNyt_b%2F-MUoUsYIi5wVNygJkMKF%2F-MUsfyyfKgItn9gmI1Za%2Fimage.png?alt=media\&token=c917c326-7bde-4903-bf66-44cdbc7cb4e4)

* Open a git-bash terminal and verify if Python installed OK
* `py -3 -V`
* `Python 3.9.2`

> &#x20;Note: To open an interactive Python interpreter you can typically just use the command **`python`** at the command prompt. Within **`git-bash`** you need to use the command **`python -i`** to explicitly start the `i`interactive interpreter.

#### Python Virtual Environments

A Python installation may not meet the requirements of every application. If application A needs v1 of a particular module and application B needs v2 - then we have problems as only ONE of the 2 applications will work, not both as required.\
This is where virtual environments come in. Application A can have its own virtual environment wctith v1 installed and application B will have its own virtual environment with v2. If B needed to be upgraded to v3 it wont affect application A.

To create a VE, decide upon a directory where you want to place it and run the **`venv`** module as a script with the directory path:

***`python3 -m venv mynamed-place`***&#x74;his will create the `mynamed-place` directory if it doesn't exist. \
A common ***directory location*** for a VE is **`.venv`**. This name keeps the directory typically hidden in your shell and thus out of your way. It also prevents clashing with `.env` environment variable definition files that some tooling supports.

To **ACTIVATE** this environment\
\&#xNAN;**`source mynamed-place\Scripts\activate`** (This script is written for the bash shell. If you use the **csh** or **fish** shells, there are alternate `activate.csh` and `activate.fish` scripts you should use instead.)

&#x20;Look for the name of the virtual environment to be enclosed in parenthesis after activation.

![](https://4011257951-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtfmTuncdFr6DnNyt_b%2F-MUoUsYIi5wVNygJkMKF%2F-MUtfNlRJn8WIWvSOyqT%2Fimage.png?alt=media\&token=e9232cac-69ec-4e74-aa1c-965c183a4680)

Test that Python is linked to the venev and we can see above it is :)

We will now deactivate that test `mynamed-place venv`

`deactivate`

#### Installing Nodejs

* [Download](https://nodejs.org/en/download/) nodejs and download the "Windows Installer"
* Open git-bash terminal
* Check the installed version
  * **`node -v`**

####
