DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

automate network infrastructure. Many of these modules
are used throughout this book, so you will be able to see
them in action. The following list provides a description
of each one, how to install it (if it is not part of the
standard library), and the syntax to use in your Python
import statement:


General-purpose standard library modules:
pprint: The pretty print module is a more intelligent print
function that makes it much easier to display text and data by, for
example, aligning data for better readability. Use the following
command to import this module:

from pprint import pprint

sys: This module allows you to interact with the Python
interpreter and manipulate and view values. Use the following
command to import this module:

import sys

os: This module gives you access to the underlying operating
system environment and file system. It allows you to open files and
interact with OS variables. Use the following command to import
this module:

import os

datetime: This module allows you to create, format, and work
with calendar dates and time. It also enables timestamps and other
useful additions to logging and data. Use the following command
to import this module:

import datetime

time: This module allows you to add time-based delays and clock
capabilities to your Python apps. Use the following command to
import this module:
Free download pdf