July 2019
Beginner to intermediate
740 pages
16h 52m
English
Let's start our discussion with the utils.py functions, which are helpers for our simulator class. First, we create our docstring for the module and handle our imports:
"""Utility functions for the login attempt simulator."""import ipaddressimport itertoolsimport jsonimport randomimport string
Next, we define the make_userbase() function, which makes the user base for our web application. It creates a file of usernames by combining one lowercase letter from the English alphabet with each last name in the list inside the function, and adds a few administrative accounts, as well; this results in a user base of 133 accounts. By writing to the file, we ensure we don't have to generate this every time we run our simulation and ...
Read now
Unlock full access