-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterpolacao.py
More file actions
39 lines (31 loc) · 855 Bytes
/
Copy pathinterpolacao.py
File metadata and controls
39 lines (31 loc) · 855 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
34
35
36
37
38
39
#!/usr/bin/python3
__version__ = "0.1.1"
__author__ = "Juliene"
import sys
import os
arguments = sys.argv[1:]
if not arguments:
print("Informe o nome do arquivo de emails")
sys.exit(1)
filename = arguments[0]
templatename = arguments[1]
path = os.curdir
filepath = os.path.join(path, filename)
templatepath = os.path.join(path, templatename)
for line in open(filepath):
name, email = line.split(",")
#TODO: Substituir por envio de email
print(f"Enviando email para: {email}")
print()
print(
open(templatepath).read()
% {
"nome": name,
"produto": "caneta",
"texto": "um problema complexo demais para ser digitado",
"link": "https://hackeeivoce.com.br",
"quantidade": 30,
"preco": 99.9,
}
)
print("-" * 50)