Skip to content

Conversation

chrisdoc
Copy link

This PR adds advent of code 2020 files based on my users sessions to the repository to fix a FileNotFoundError when running the advent of code 2020 notebook https://github.com/norvig/pytudes/blob/master/ipynb/Advent-2020.ipynb

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-4-f1ec783705fc> in <module>
----> 1 in1: Set[int] = set(data(1, int))

<ipython-input-2-8ad9be6051d4> in data(day, parser, sep)
      1 def data(day: int, parser=str, sep='\n') -> list:
      2     "Split the day's input file into sections separated by `sep`, and apply `parser` to each."
----> 3     with open(f'data/advent2020/input{day}.txt') as f:
      4         sections = f.read().rstrip().split(sep)
      5         return list(map(parser, sections))

FileNotFoundError: [Errno 2] No such file or directory: 'data/advent2020/input1.txt'

Copy link

@Adam-Katz Adam-Katz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input1.txt is not equal to the data provided by AoC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants