14 lines
303 B
Python
14 lines
303 B
Python
|
import re
|
||
|
import os
|
||
|
|
||
|
def find_digits(file_path):
|
||
|
with open(file_path, 'r', encoding='utf-8') as file:
|
||
|
txt = file.read()
|
||
|
pattern = re.compile(r'\d+')
|
||
|
return pattern.findall(txt)
|
||
|
|
||
|
|
||
|
|
||
|
path = os.path.join(os.path.dirname(__file__), 'simple.in')
|
||
|
matches = find_digits(path)
|
||
|
print(matches)
|