更新时间:2021-07-16 17:41:05
封面
Title Page
Copyright and Credits
Mastering Python for Networking and Security
Packt Upsell
Why subscribe?
Packt.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Working with Python Scripting
Technical requirements
Programming and installing Python
Introducing Python scripting
Why choose Python?
Multi-platform
Object-Oriented Programming
Obtaining and installing Python
Installing Python on Windows
Installing Python for Linux
Python collections
Lists
Reversing a List
Comprehension lists
Tuples
Dictionaries
Python functions and managing exceptions
Python functions
Managing exceptions
Python as an OOP language
Inheritance
The OMSTD methodology and STB Module for Python scripting
Python packages and modules
What is a module in Python?
Difference Between a Python Module and a Python Package
Passing parameters in Python
Managing dependencies in a Python project
Generating the requirements.txt file
Working with virtual environments
Using virtualenv and virtualwrapper
The STB (Security Tools Builder) module
The main development environments for script-development
Setting up a development environment
Pycharm
WingIDE
Debugging with WingIDE
Summary
Questions
Further reading
System Programming Packages
Introducing system modules in python
The system module
The operating system module
Contents of the current working directory
Determining the operating system
Subprocess module
Working with the filesystem in Python
Accessing files and directories
Recursing through directories
Checking whether a specific path is a file or directory
Checking whether a file or directory exists
Creating directories in Python
Reading and writing files in Python
File methods
Opening a file
With a Context Manager
Reading a file line by line
Threads in Python
Introduction to Threads
Types of threads
Processes vs Threads
Creating a simple Thread
Threading module
Multithreading and concurrency in Python
Introduction to Multithreading
Multithreading in Python
Limitations with classic python threads
Concurrency in python with ThreadPoolExecutor
Creating ThreadPoolExecutor
ThreadPoolExecutor in practice
Executing ThreadPoolExecutor with Context Manager
Python Socket.io
Introducing WebSockets
aiohttp and asyncio
Implementing a Server with socket.io
Socket Programming