-
Notifications
You must be signed in to change notification settings - Fork 5
/
python-example.py
30 lines (24 loc) · 969 Bytes
/
python-example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def greet_user(name):
"""
Función que saluda al usuario.
"""
return f"Hola, {name}! Bienvenido al proyecto de ejemplo."
#Add collaborators to the list
def get_collaborators(file_path):
collaborators = []
with open(file_path, 'r', encoding='utf-8') as file:
in_collaborators_section = False
for line in file:
if "## Colaboradores" in line:
in_collaborators_section = True
continue
if in_collaborators_section and line.strip() == "":
continue
if in_collaborators_section:
name = line.split(".", 1)[1].strip() if "." in line else line.strip()
collaborators.append(name)
return collaborators
# Read collaborators
collaborators = get_collaborators("D:\\Imer\\CursosDictar\\workshopGit\\README.md")
for collaborator in collaborators:
print(greet_user(collaborator))