hands-on lab

Programming with Python Introduction

Beginner
1h 30m
3,128
4.6/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

Lab Overview

Python 3 is a highly productive scripting language that can be used in almost all use cases. You'll be shown the different approaches to invoking and executing Python scripts. You will be required to complete each of the following Python coding exercises:

  • Exercise 1 - HelloWorld: Complete the code required to work with and manipulate string variables, printing out messages to the console. Additionally, you will be shown the different methods available to launching your python code
  • Exercise 2 - LaunchExternalProgram: Complete the code required to launch the local netstat command using the operating system services within the os Python module, printing out local network connection stats
  • Exercise 3 - Traversal: Complete the code required to perform a folder and file traversal using the operating system services within the os Python module, printing out the size of each file discovered

Note: Each exercise has a provided solution to consult with when needed.

Lab Objectives

Upon completion of this lab, you will be able to:

  • Write Python script that creates string variables and manipulates strings
  • Write Python script that prints out to the console
  • Understand the different approaches to launching a Python script
  • Use the terminal to launch and debug Python scripts

You should:

  • Be comfortable with using a browser-based IDE

Lab Environment

This lab will start with the following AWS resources provisioned automatically for you:

  • A single EC2 instance, named ide.python.platform.instance, which will have a public IP address attached. This instance will host a web-based Python IDE (based on the Visual Code editor).

To achieve the lab end state, you will be walked through the process of:

  • Using your local browser, access the web-based Java IDE served from the ide.python.platform.instance
  • Completing the following lab exercises:
    • Exercise 1 - HelloWorld
    • Exercise 2 - LaunchExternalProgram
    • Exercise 3 - Traversal

Updates

December 10, 2021 - Updated the name of a file to match screenshots

May 12th, 2020  - Updated the lab instructions to allow for proper interaction with the lab files.

June 16th, 2018 - Optimized creation of lab resources to reduce the time it takes to access the browser IDE by 60%.

About the author
Avatar
Jeremy Cook
Content Lead Architect
Students
159,312
Labs
80
Courses
108
Learning paths
212

Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.

He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, Azure, GCP), Security, Kubernetes, and Machine Learning.

Jeremy holds professional certifications for AWS, Azure, GCP, Terraform, Kubernetes (CKA, CKAD, CKS).

Covered topics
Lab steps
Connecting to the Python Web IDE
Exercise 1 - Hello World
Exercise 2 - Launch External Command
Exercise 3 - Directory Traversal