forked from junejaalok/github-workflow-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
19 lines (18 loc) · 645 Bytes
/
main.py
File metadata and controls
19 lines (18 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
This will import all modules with name group*.py
and print the result of the corresponding tweet() function
implemented in group*.py.
"""
#HELLO!
import os
for filename in os.listdir("."):
if filename.startswith("group") and filename.endswith(".py"):
module_name = filename[:-3]
try:
module = __import__(module_name)
group_name = module_name.replace("group", "") \
.replace("_", "") \
.replace("-", "")
print("group {0} says: {1}".format(group_name, module.tweet()))
except ImportError:
pass