advent-of-code/_templates/riddle/new/python.ejs.t

27 lines
371 B
Perl
Raw Normal View History

2021-12-01 14:46:12 +01:00
---
to: <%= year %>/<%= day %>/python/main.py
---
#!/usr/bin/env python
from os.path import join, dirname
2021-12-03 08:58:27 +01:00
# Day <%= day %>
2021-12-01 14:46:12 +01:00
# Common
def read_input(filename):
data = join(dirname(__file__), '..', filename)
with open(data) as f:
2021-12-03 08:58:27 +01:00
return f.read().strip()
2021-12-01 14:46:12 +01:00
2021-12-07 12:13:33 +01:00
test = read_input('test.txt')
data = read_input('input.txt')
2021-12-01 14:46:12 +01:00
# 1
2021-12-07 12:10:13 +01:00
print('1.')
2021-12-01 14:46:12 +01:00
# 2
2021-12-07 12:10:13 +01:00
print('\n2.')