To get started, follow these commands to set up the Python environment. This will run jobs from the Makefile
to automatically install python versions, set up dependencies and locally install my jono_aoc_helpers
python package.
$ pwd
/advent-of-code-python
$ cd 2024 && pwd
/advent-of-code-python/2024
# Run helper for python version, venv, dependencies
$ make setup
✅ Development environment ready to go!
All solutions are designed to be ran from the root year folder.
$ pwd
/advent-of-code-python/2024
$ python day_00_template/day_00.py
You can select the log level by passing in an argument with -l
or --log-level
or by setting an environment variable AOC_LOG_LEVEL
.
If not specified then the default behaviour is INFO
.
# Command line argument
$ pwd
/advent-of-code-python/2024
$ python day_00_template/day_00.py -l DEBUG
$ python day_00_template/day_00.py --log-level DEBUG
# Environment variable
export AOC_LOG_LEVEL=DEBUG
The accepted inputs are:
DEBUG
INFO
WARNING
ERROR
CRITICAL
If for any reason you need to remove the virtual environment and start again, you can run the following:
$ pwd
/advent-of-code-python/2024
$ make clean
When starting a new problem, you can run the following command to set up the subdirectory and create a skeleton solution file:
$ pwd
/advent-of-code-python/2024
$ make newday DAY=3