-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy path4-complete.py
47 lines (32 loc) · 999 Bytes
/
4-complete.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from time import sleep
print("This is my file to demonstrate best practices.\n")
def process_data(data: str) -> str:
"""
Example Function with DocStrings and Annotation Function.
In this file Python view the best pratices write a Python file using main()
:arg:
data: A data to process.
:return:
A data changed of type String.
:raises:
None
"""
print("Beginning data processing...")
modified_data = data + " that has been modified" # type: str
sleep(8)
print("Data processing finished.")
return modified_data
def read_data_from_web():
print("Reading data from the Web")
data = "Data from the web"
return data
def write_data_to_database(data):
print("Writing data to a database")
print(data)
def main():
data = read_data_from_web()
modified_data = process_data(data)
write_data_to_database(modified_data)
if __name__ == "__main__":
# execute only if run as a script
main()