From 52ce2afc40e599138d643fe04d42f9c149d91192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 9 Dec 2020 08:14:27 +0100 Subject: common input --- 20/py/d02.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '20/py/d02.py') diff --git a/20/py/d02.py b/20/py/d02.py index 572404e..1ec2b8f 100644 --- a/20/py/d02.py +++ b/20/py/d02.py @@ -1,4 +1,8 @@ #!/usr/bin/env python3 +import aoc20 +import sys + + def pt1(_in): valid = 0 for passwd in _in: @@ -27,6 +31,6 @@ def pt2(_in): if __name__ == "__main__": - input = open("../input/02", "r").readlines() + input = aoc20.read_input(sys.argv[1:], 2) print(pt1(input)) print(pt2(input)) -- cgit v1.2.1