[py] Match rust input and output format
This commit is contained in:
parent
1e6fdd7d35
commit
dd2fc5c095
1 changed files with 8 additions and 4 deletions
|
|
@ -17,19 +17,23 @@ DAYS = {
|
|||
}
|
||||
|
||||
|
||||
def eprint(*args, **kwargs):
|
||||
print(*args, **kwargs, file=sys.stderr)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("files", type=Path, nargs="+")
|
||||
args = parser.parse_args()
|
||||
|
||||
for file in args.files:
|
||||
day = DAYS.get(file.stem)
|
||||
day = DAYS.get(file.stem[:7])
|
||||
if day is None:
|
||||
print(f"### Can't solve {file}", file=sys.stderr)
|
||||
eprint(f"### Can't solve {file}")
|
||||
continue
|
||||
|
||||
print(f"### Solving day {file.stem}")
|
||||
eprint(f"### Solving {file}")
|
||||
with open(file) as f:
|
||||
inputstr = f.read()
|
||||
day(inputstr)
|
||||
print()
|
||||
eprint()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue