forked from Shihadt/status_report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_file.py
40 lines (36 loc) · 953 Bytes
/
make_file.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
from datetime import datetime
def read_sign(filename):
inp = open(filename,'r')
return inp.readline()
def write_to_file(filename,project, work_done, todo,path):
date_formated = format_date()
out = open(filename,"w+")
out.write("""
<html>
<body>
<font face='Arial'>
Project Name: """
+ project +
"""<br>
Date: """
+ date_formated +
"""<br><br> <b>Work Done:</b>"""
+ work_done +
""" <b>To Do:</b>"""
+ todo +
read_sign(path+'sign.html')
+
"""
</body>
</html>""")
def read_file(filename):
fin = open(filename,'r')
html = "<ul type='disc'>"
for line in fin:
html = html + "<li>" + line + "</li>"
html = html + "</ul>"
return html
def format_date():
today = datetime.now()
date_formated = today.strftime("%B")[0:3] + " " + str('{0:02d}'.format(today.day) ) + ", " + str( today.year)
return date_formated