From 3131c52c827156ea94d6248aadb984fb69cc3d57 Mon Sep 17 00:00:00 2001 From: Daniel Heras Quesada Date: Mon, 24 Aug 2026 22:52:30 +0200 Subject: [PATCH] fix: automatic import + readme structur --- .editorconfig | 16 +++++++++ README.md | 33 ++++++++++++++++++ src/main.py | 5 ++- src/modules/__pycache__/day_1.cpython-314.pyc | Bin 0 -> 296 bytes src/{calendar => modules}/day_1.py | 0 .../test_day_1.cpython-314-pytest-9.1.1.pyc | Bin src/{calendar => modules}/tests/test_day_1.py | 0 7 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 src/modules/__pycache__/day_1.cpython-314.pyc rename src/{calendar => modules}/day_1.py (100%) rename src/{calendar => modules}/tests/__pycache__/test_day_1.cpython-314-pytest-9.1.1.pyc (100%) rename src/{calendar => modules}/tests/test_day_1.py (100%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bfea71f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +[*.{md,py}] +charset = utf-8 + +[*.py] +indent_style = space +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/README.md b/README.md index e69de29..eef35b7 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,33 @@ +# code-advent-2023 + +[Advent of Code](https://adventofcode.com/2023) problems of 2023. + +## Progress + +| Day | Name | Part 1 | Part 2 | +| :-: | :------------------ | :----: | :----: | +| 1 | | | | +| 2 | | | | +| 3 | | | | +| 4 | | | | +| 5 | | | | +| 6 | | | | +| 7 | | | | +| 8 | | | | +| 9 | | | | +| 10 | | | | +| 11 | | | | +| 12 | | | | +| 13 | | | | +| 14 | | | | +| 15 | | | | +| 16 | | | | +| 17 | | | | +| 18 | | | | +| 19 | | | | +| 20 | | | | +| 21 | | | | +| 22 | | | | +| 23 | | | | +| 24 | | | | +| 25 | | | | diff --git a/src/main.py b/src/main.py index 1a8824d..295ce68 100644 --- a/src/main.py +++ b/src/main.py @@ -3,8 +3,11 @@ import sys if __name__ == "__main__": if sys.argv.__len__() != 2: print("[ERROR] Only the day should be specified") + print(" $ python src/main.py 1") + print(" $ make DAY='1'") sys.exit(-1) - module_selected = __import__(f"calendar.day_{sys.argv[1]}", fromlist=[""]) + module_path = "modules.day_" + sys.argv[1] + module_selected = __import__(module_path, fromlist=[""]) module_selected.run() diff --git a/src/modules/__pycache__/day_1.cpython-314.pyc b/src/modules/__pycache__/day_1.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1877ccc9dae6565b6c946bfe9f6c2c7faefca4ec GIT binary patch literal 296 zcmdPq^MJU~VRLlA>FLkU9=qcVdgQ!-2qh-QZ3&oV$p z149f)DRIBXzB*%g8GfHi|c