| File and Directory Operations |
os, os.path, shutil, pathlib, tempfile |
Provide operating system interfaces for file/directory creation, deletion, copying, moving, path processing, and temporary file management. |
| Data Processing and Formats |
json, xml, csv, configparser, pickle, sqlite3, collections, itertools |
Process JSON/XML/CSV data, parse configuration files, serialize objects, operate SQLite databases, and provide efficient container/iterator tools. |
| System Interaction and Processes |
sys, subprocess, argparse, logging, platform |
Access command-line arguments, start subprocesses, record logs, obtain system information, and interact with the Python interpreter. |
| Text Processing |
re, string, difflib, textwrap |
Regular expression matching, string operations, text difference comparison, automatic line wrapping/filling and other text processing functions. |
| Date and Time |
datetime, time, calendar |
Process dates, times, and calendars, supporting time calculation, formatted output, and time zone conversion. |
| Mathematics and Scientific Computing |
math, cmath, random, statistics, fractions, decimal |
Provide mathematical functions, complex number operations, random number generation, statistical calculations, and high-precision fraction/decimal operations. |
| Concurrency and Asynchrony |
threading, multiprocessing, concurrent.futures, asyncio, queue |
Implement multi-threading, multi-processing, thread pools/process pools, and asynchronous IO programming, supporting task queues and concurrency control. |
| Debugging and Testing |
pdb, unittest, doctest, traceback |
Code debugging, unit testing, document testing, and exception stack information acquisition, facilitating development and testing processes. |
| Network Communication |
socket, urllib, http, ftplib, smtplib |
Implement low-level network communication, HTTP requests, FTP file transfer, email sending and other network protocol functions. |
| Encryption and Security |
hashlib, hmac, secrets |
Provide hash algorithms, message authentication codes, secure random number generation, and SSL/TLS encrypted communication support. |
评论