master
E. Almqvist 4 years ago
parent 4336a56e1f
commit 5ab9dcf6a1
  1. 6
      2020/2.py
  2. 7
      2020/aoc/_api.py
  3. 1000
      2020/input.2
  4. 0
      2020/input.2.2
  5. 2
      2020/year.txt

@ -1,11 +1,7 @@
#!/usr/bin/env python
from aoc import get_input
#data = get_input(2).splitlines()
#print(data)
inp = open("input.2", "r")
inp = inp.read().splitlines()
inp = get_input(2).splitlines()
def getOper(inp):
ops = []

@ -47,12 +47,9 @@ def get_input(day: int, year: int = YEAR, overwrite: bool = False):
if overwrite:
data = None
if not data:
response = requests.get(
f"https://adventofcode.com/{year}/day/{day}/input",
cookies={"session": SESSION})
url = f"https://adventofcode.com/{year}/day/{day}/input".replace("\n", "")
response = requests.get(url, cookies={"session": SESSION})
if not response.ok:
if response.status_code == 404:
raise FileNotFoundError(response.text)
raise RuntimeError(f"Request failed, code: {response.status_code}, message: {response.content}")
data = _set_read_file(
file_name,

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
2020
2020
Loading…
Cancel
Save