mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
9 lines
283 B
Python
9 lines
283 B
Python
import os
|
|
|
|
|
|
def get_data(day: int, sub: int | None = None) -> str:
|
|
basename = f"{day:02d}" if sub is None else f"{day:02d}.{sub}"
|
|
sample = os.path.dirname(__file__) + f"/samples/{basename}.txt"
|
|
with open(sample, mode="rt", encoding="utf-8") as f:
|
|
return f.read()
|