24 lines
558 B
Python
24 lines
558 B
Python
task_file = "/home/mariano/LETRAS/org/task/main"
|
|
|
|
|
|
def extract(line):
|
|
if line.rstrip().endswith("*"):
|
|
pipe_index = line.find("|")
|
|
if pipe_index != -1 and len(line) > pipe_index + 8:
|
|
value = line[pipe_index + 1 : pipe_index + 9]
|
|
return value
|
|
return None
|
|
|
|
|
|
def read_and_extract(file_path):
|
|
with open(file_path, "r") as file:
|
|
for line in file:
|
|
value = extract(line)
|
|
if value:
|
|
return value
|
|
return None
|
|
|
|
|
|
def current():
|
|
return read_and_extract(task_file)
|