Skip to content

Instantly share code, notes, and snippets.

@thorstel
Last active January 23, 2021 10:04
Show Gist options
  • Save thorstel/2cfd30169f02c4cca2a56c0cc20e580c to your computer and use it in GitHub Desktop.
Save thorstel/2cfd30169f02c4cca2a56c0cc20e580c to your computer and use it in GitHub Desktop.
Python Advent of Code template for pasting the input directly into source
# TODO URL
from collections import *
from functools import *
import itertools
import re
import sys
def solve(data):
for line in data.splitlines():
print(line)
########################################################################
# SETUP STUFF #
########################################################################
sample_input = r"""
""".strip()
actual_input = r"""
""".strip()
if len(sys.argv) > 1:
with open(sys.argv[1], 'r') as f:
file_input = f.read().strip()
solve(file_input)
else:
print('=== SAMPLE ===')
solve(sample_input)
print('=== ACTUAL ===')
solve(actual_input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment