accept input file as cmdline argument

This commit is contained in:
thib8956 committed 2025-01-04 15:38:12 +01:00
1 parent 89b6b5e107
commit 87871aed4d
13 files changed
+41 -19

No files matched your search

+3 -1
View File
@@ -17,6 +17,8 @@ def main(inp):
if __name__ == '__main__':
with open("input.txt") as inp:
import sys
infile = sys.argv[1] if len(sys.argv) > 1 else "example.txt"
with open(infile) as inp:
main(inp.readlines())