Technical requirements
You will need some basic knowledge about command execution in operating systems to get the most out of this chapter. Also, before you begin, install the Python distribution on your local machine. We will work with Python version 3.10, which is available at https://www.python.org/downloads.
Some of the examples in this chapter require the installation of the following programs:
Nmap port scanner: https://nmap.org/
The examples and source code for this chapter are available in the GitHub repository at https://github.com/PacktPublishing/Python-for-Security-and-Networking.
Check out the following video to see the Code in Action: https://packt.link/Chapter02.
Interact with the operating system in Python
The OS module is one of the best mechanisms to access the different functions in our operating system. Your use of this module will depend on which operating system is being used. For example, you need to use different commands depending on...