Description:

In this 7-video course, learners discover key differences between Python 2 and Python 3, as well as learn how to perform a Python 2 migration to Python 3. Several other topics are also covered. Begin by observing how to set up the Jupyter Notebook integrated developer environment (IDE) to run and develop Python 2 code by installing a kernel for it. The next two tutorials will examine the differences between Python 2 and Python 3—part 1 will recall the variations in syntax and output for various operations such as print, division, and round for Python 2 versus Python 3; and part 2 explores differences in the round function behavior and different ways to accept user input in Python versions 2 and 3. Next, use the 2to3 conversion tool to identify the lines in your Python 2 scripts that need to be altered for Python 3 compatibility, and finally, explore how to convert a Python 2 script to be Python 3 compatible by using the 2to3 conversion tool.

Target Audience:

Duration: 00:40

Description:

Learners can explore built-in Python modules that allow you to perform many common operations without having to write the associated code, in this 9-video course. These operations range from random number generation to frequently used math calculations. You will learn how to recognize the features available in popular Python libraries such as NumPy, random, and datetime. Also, you will take a look at the steps involved in packaging Python code into a tar archive for distribution to end users; use pip to install a module in your environment and import it into your Python applications, and learn how to install the virtualenv tool and use it to create a virtual environment for Python applications. In the final two tutorials in this course, you will discover how to activate and run Python scripts from within virtual environments, and then install different packages in different virtual environments and recognize how they are isolated from each other.

Target Audience:

Duration: 01:00

Description:

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.

Target Audience:

Duration: 01:13

Description:

Python includes functions and modules that simplify working with files. In this 11-video course, explore operations for standard text files and handling of formatted data such as JSON and CSV by using Python modules designed for such data. Learners begin with a look at some of the file operations in Python. Use Python's open function to open a file for reading, and differentiate between the read(), readline(), and readlines() functions. View differences between opening a file in write mode and append mode in Python. This leads on to distinguishing between the r+ and a+ modes to read from and write to a file; using load and loads functions of the json module to parse JSON data, and converting Python dictionaries and lists into JSON strings and files. Next, learn how to identify file formats that can be handled by the CSV module in Python, and convert Python dictionaries and lists into CSV files. The final tutorial concerns defining a customized file format, creating a CSV dialect, and using that to parse and write data.

Target Audience:

Duration: 01:12