terminalmage / adventofcode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code

My scripts for Advent of Code.

These scripts are written in Python 3, and some of them use syntax introduced in Python 3.8 (the "walrus operator") and 3.10 (Structural Pattern Matching). If you do not have Python 3.10 available and would like to run these scripts, you have a couple options:

  1. Use the official Docker images for Python. For example, from the root of this git repository, run the following command:

    docker run --rm -it -v $PWD:/scripts python:3.10-slim bash

    This will give you a bash shell, from which you can cd to the bind-mounted scripts dir and run the scripts:

    cd /scripts/2022
    ./day01.py

    When done, exit from the shell (run exit or use Ctrl-d) and the container will be destroyed.

  2. Use pyenv to build a Python 3.10 release. This will also require that you have installed the build dependencies.

About


Languages

Language:Python 100.0%