Use pathlib for input.txt path
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/phon3
|
||||
|
||||
#!/usr/bin/phyton3
|
||||
from pathlib import Path
|
||||
from collections import defaultdict
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ def part_2(input):
|
||||
|
||||
|
||||
input = list()
|
||||
with open('input.txt') as fp:
|
||||
input = fp.readlines()
|
||||
|
||||
part_1(input)
|
||||
part_2(input)
|
||||
p = Path(__file__).with_name('input.txt')
|
||||
with open(p) as f:
|
||||
input = f.readlines()
|
||||
part_1(input)
|
||||
part_2(input)
|
||||
|
||||
Reference in New Issue
Block a user