Development Environment
Introduction

As mentioned, this is also not a class about learning Python. We selected Python due to its popularity, readability, and the abundance of external libraries and Software Development Kits (SDKs) like wxc_sdk. If you've had some experience with Python, even as a novice, the concepts introduced here shouldn't be overly complicated. If you're new to Python, don't worry; we've provided enough guidance for you to complete the tasks with little to no prior knowledge.

In Python, indentation and spacing are essential for defining code structure, replacing the need for curly braces or keywords. As you complete the lab, ensure your code is properly indented, using comments or existing code as alignment guides. Correct indentation is crucial for your code to work correctly.

For all Python coding in this project, you will use Visual Studio Code (VS Code), a popular free source code editor from Microsoft. You will edit and run your Python code in this lab environment on a remote Linux development server. Your Pod's dedicated development server has a web-based VS Code instance running on it. This web-based VS Code application is called code-server and behaves identially to VS Code running locally on your PC. You can find more information about VS Code, code-server, and your development environment in the Reference section of this lab guide.

To begin, you will launch VS Code and run a simple Python program by following the steps below.

Step 1 - Launch Visual Studio Code

  1. Access your VS Code instance: https://dev1.pod6.col.lab:8443

  2. On the left side, click the Explorer icon and you see a list of folders and files under Workspace. The files you will be working with initially will be in the examples folder.
  3. In the Explorer, navigate to examples and click to open hello_world.py. You now have the file open for editing.

Step 2 - Run a Program

One of VS Code's features is the ability to run applications from within the development environment.

  1. In VS Code, click the Run and Debug button.
  2. Once you click anywhere in list of "RUN AND DEBUG" configurations, You should see a predefined Configuration for running a python script named Python: hello_world.py at the top of the list. Make sure it is selected:
  3. Click the green start arrow next to the RUN AND DEBUG text . Doing so launches a terminal window at the bottom where the output of the script is displayed.

  4. You will notice that the output is displayed as a log line, since the "logging" facility was used to display the text instead of a print. This is how we will generally display all console-type output.

Congratulations on successfully running your first Python program in Visual Studio Code! You are now well-equipped to delve into the world of Cisco Webex APIs.