Closure#
Syllabus Week 13: Modules#
User-made modules, using them and creating them
Import statement, standard import, selective import and alias import
The
dir
function
Advanced#
Advanced 13.1: Useful Modules in the Python Standard Library#
shutil
: A module that provides file operation: copying, moving, removing, zipping, etc.glob
: A module for making file lists from directory wildcard searches.collections
: A module with specialized container datatypes providing alternatives to Python’s general-purpose built-in containers.datetime
: A module with classes for manipulating dates and times.random
: A module that implements pseudo-random number generators.time
: A module that provides time-related functions.argparse
: A module that makes it easy to write command-line programs.json
: A module that for encoding and decoding JSON data.pickle
: A module with protocols for loading and saving Python objects.csv
: A module for reading and writing CSV files.statistics
: A module with functions for mathematical statistics of numeric data.
Advanced 13.2: Other Useful Third-party Libraries#
Here is a list of some other useful Python libraries that you might find useful:
pandas
: A library for data manipulation and analysis.scikit-learn
: A library for machine learning in Python.requests
: A library for making HTTP requests in Python.pytest
: A testing framework for Python.opencv-python
: A library for computer vision in Python.pillow
: A library for image processing in Python.pytorch
: A library for deep learning in Python.sympy
: A library for symbolic mathematics in Python.
For example, check how https://cs50.harvard.edu/python/2022/notes/4/#apis uses the requests
library to make HTTP requests to a web server.
Advanced 13.3: Advent of Code#
In December, you might like to try Advent of Code, an Advent calendar of small programming puzzles that can be solved in any programming language. The puzzles are released daily, and require only basic programming skills to solve. There are usually two parts to each puzzle, the first being easier than the second.