forked from miczar1/djfz-24_25
18 lines
438 B
Python
18 lines
438 B
Python
|
import sys
|
||
|
import re
|
||
|
|
||
|
def solve(lines):
|
||
|
return [l for l in lines if re.search("Hamlet", l)]
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
lines = []
|
||
|
|
||
|
fp = sys.argv[1]
|
||
|
assert(fp == "shakespeare.in") # just a sanity check
|
||
|
|
||
|
print(fp)
|
||
|
with open(fp, encoding="utf-8") as f:
|
||
|
lines = f.readlines()
|
||
|
sol = solve(lines)
|
||
|
with open("./shakespeare.out", 'w', encoding="utf-8") as f:
|
||
|
f.writelines(sol)
|