mirror of
https://github.com/thib8956/advent-of-code.git
synced 2025-07-01 14:25:48 +00:00
accept input file as cmdline argument
This commit is contained in:
@ -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())
|
||||
|
||||
|
Reference in New Issue
Block a user