-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpath.py
More file actions
33 lines (25 loc) · 745 Bytes
/
Copy pathpath.py
File metadata and controls
33 lines (25 loc) · 745 Bytes
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
import os
import datetime
class pathClass:
path = "templates\\template.txt"
def pathMeth():
pwd = os.getcwd()
# filename="template.txt"
f_path = os.path.join(pwd, pathClass.path)
# if not os.path.isfile(f_path):
# raise Exception("Template file not found!")
return f_path
def getTemplate():
file_path = pathClass.pathMeth()
return open(file_path).read()
"""
def formatTemplate(tempText, dataItems):
return(tempText.format(**dataItems))
date_tdy = datetime.date.today()
path = "templates\\template.txt"
dataItems = {
"name":
"date":
"total":
print(formatTemplate(getTemplate(path), dataItems))
"""