Advanced Python Topics: Exceptions & Command Line Arguments
Python
| Beginner
- 11 videos | 1h 12m 19s
- Includes Assessment
- Earns a Badge
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 courseUse a try and except block to handle a python exceptionControl how you handle exceptions that your code may raiseRecognize how exceptions are defined in a hierarchy and how related exceptions can be caught and handledDefine multiple except blocks to handle various exceptions that can be raised by your codeConvert 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 commandsUse the sys and argparse module to access command line arguments to a python scriptParse and use the arguments passed to a python script from the command lineDefine the names and other customizable features of command line arguments to a python script using the argparse moduleSummarize the key concepts covered in this course
IN THIS COURSE
-
2m 8s
-
7m 20sIn this video, learn how to use a try/except block to handle a Python exception. FREE ACCESS
-
5m 57sIn this video, you will learn how to handle exceptions that your code may raise. FREE ACCESS
-
7m 51sAfter completing this video, you will be able to recognize how exceptions are defined in a hierarchy and how related exceptions can be caught and handled. FREE ACCESS
-
9m 15sIn this video, you will define multiple except blocks to handle various exceptions that can be raised by your code. FREE ACCESS
-
7m 30sIn this video, you will learn how to go from Jupyter Notebooks to Python Scripts. You will also discover the main factors involved when building your prototype in Jupyter notebooks and later deploying them as Python source files. FREE ACCESS
-
9m 20sIn this video, you will learn how to use the Python Shell. You will also discover how to bring up a shell environment on your own system. FREE ACCESS
-
9m 2sIn this video, you will learn how to parse command line arguments in a Python script. FREE ACCESS
-
4m 57sIn this video, you will learn how to access the command line arguments which have been passed to a Python script. FREE ACCESS
-
7m 36sIn this video, you will learn how to define command-line arguments using argparse. You will also discover how to include documentation with regards to an argument. FREE ACCESS
-
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 on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.