Advanced Python Topics: Exceptions & Command Line Arguments

Python 3+
  • 11 Videos | 1h 16m 49s
  • Includes Assessment
  • Earns a Badge
Likes 51 Likes 51
In this 11-video course, learners can examine different types of exceptions that can be raised in Python and how they can be handled with except blocks. Explore execution of Python scripts from the command line, including use and parsing of command-line arguments. To begin, use a try and except block to handle a Python exception, then learn how to handle exceptions that your code may raise. Explore how exceptions are defined in a hierarchy and how related exceptions are caught and handled. Next, define multiple except blocks to handle various exceptions that can be raised by code; convert code prototyped in a Jupyter notebook into a Python script that can be executed from a shell, and run code from the Python shell and execute single-line and multi-line commands. Learn about parsing command line arguments, and use the sys and argparse module to access command-line arguments to a Python script, then parse and use the arguments passed to a Python script from the command line. Finally, learn to define command-line arguments by using argparse.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    use a try and except block to handle a Python exception
    control how you handle exceptions that your code may raise
    recognize how exceptions are defined in a hierarchy and how related exceptions can be caught and handled
    define multiple except blocks to handle various exceptions that can be raised by your code
    convert code prototyped in a Jupyter notebook into a Python script that can be executed from a shell
  • run your code from the Python shell and recognize how to execute single-line and multi-line commands
    use the sys and argparse module to access command line arguments to a Python script
    parse and use the arguments passed to a Python script from the command line
    define the names and other customizable features of command line arguments to a Python script using the argparse module
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 8s
    UP NEXT
  • Playable
    2. 
    The try and except Blocks
    7m 20s
  • Locked
    3. 
    Defining Custom Exception Handlers
    5m 57s
  • Locked
    4. 
    The Exception Hierarchy
    7m 51s
  • Locked
    5. 
    Chaining except Blocks
    9m 15s
  • Locked
    6. 
    Going from Jupyter Notebooks to Python Scripts
    7m 30s
  • Locked
    7. 
    Using the Python Shell
    9m 20s
  • Locked
    8. 
    An Introduction to Parsing Command Line Arguments
    9m 2s
  • Locked
    9. 
    Using Command Line Arguments in a Script
    4m 57s
  • Locked
    10. 
    Define Command-Line Arguments using argparse
    7m 36s
  • Locked
    11. 
    Course Summary
    1m 24s

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform

Digital badges are yours to keep, forever.

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE