Use pathlib for input.txt path
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def read_boards(input):
|
||||
boards = list()
|
||||
@@ -129,8 +131,8 @@ def part_2(input):
|
||||
|
||||
|
||||
input = list()
|
||||
with open('input.txt') as fp:
|
||||
input = fp.readlines()
|
||||
|
||||
part_1(input.copy())
|
||||
part_2(input.copy())
|
||||
p = Path(__file__).with_name('input.txt')
|
||||
with open(p) as f:
|
||||
input = f.readlines()
|
||||
part_1(input.copy())
|
||||
part_2(input.copy())
|
||||
|
||||
Reference in New Issue
Block a user