Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
114
.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ExpandedNodes": [ | ||
"" | ||
], | ||
"PreviewInSolutionExplorer": false | ||
} |
BIN
+14 KB
.vs/re_sit4006/v16/.suo
Binary file not shown.
BIN
+88 KB
.vs/slnx.sqlite
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: Current File", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eimai blakas !!! |
50
data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
def check_mail(mail): | ||
there_is_mail=False | ||
with open('mails.txt') as f: | ||
if mail in f.read(): | ||
there_is_mail=True | ||
elif mail not in f.read(): | ||
there_is_mail=False | ||
return there_is_mail | ||
|
||
def delete_mail(mail):#dele the line with mail (delete the mail from database) | ||
with open("mails.txt", "r") as f: | ||
lines = f.readlines() | ||
with open("mails.txt", "w") as f: | ||
for line in lines: | ||
if line.strip("\n") != mail: | ||
f.write(line) | ||
|
||
def write_mail(mail): #checkwrite | ||
there_is_mail=False | ||
file=open("mails.txt","r") | ||
with open('mails.txt') as f: | ||
if mail in f.read(): | ||
there_is_mail=True | ||
file.close() | ||
if there_is_mail==False: | ||
File = open("mails.txt", "a") | ||
File.write(mail+"\n") | ||
File.close() | ||
there_is_mail=True | ||
return there_is_mail | ||
|
||
def read_the_data_base():#Using readlines() | ||
print("these are mails we have in the database:") | ||
file1 = open('mails.txt', 'r') | ||
Lines = file1.readlines() | ||
count = 0 | ||
# code inspired by ---- | ||
# Strips the newline character | ||
for line in Lines: | ||
count += 1 | ||
print(format( line.strip())) | ||
|
||
def sender(mail): | ||
import smtplib | ||
import ssl | ||
from printers import message | ||
server = smtplib.SMTP_SSL("smtp.gmail.com",465) | ||
server.login("tipotanothing@gmail.com" , "tipota1345") | ||
server.sendmail("tipotanothing@gmail.com",mail,message) | ||
#server.quit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from management import management | ||
management() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
albertoxhe08@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
def management(): | ||
from data import check_mail | ||
from data import delete_mail | ||
from data import write_mail | ||
from data import read_the_data_base | ||
from data import sender | ||
from printers import start | ||
from printers import would | ||
from printers import thanks_y | ||
from printers import thanks_n | ||
from printers import thanks_s | ||
from printers import subscribe | ||
c=input(start) | ||
if check_mail(c)==True: | ||
s=input(would) | ||
if s=="y"or s=="Y": | ||
print(thanks_s) | ||
sender(c) | ||
elif s=="n"or s=="N": | ||
delete_mail(c) | ||
print (thanks_n) | ||
|
||
else: | ||
sub=input(subscribe) | ||
if sub=="y"or sub=="Y": | ||
print(thanks_y) | ||
write_mail(c) | ||
sender(c) | ||
if sub=="n"or sub=="N": | ||
print(thanks_n) | ||
read_the_data_base() |
17
printers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
start=("could you enter your email please?\n") | ||
thanks_y=("congratulations from now and the future you will be the first to receive news about perfumes\n ") | ||
thanks_n=("thank you for being with us\n") | ||
subscribe=("would you like to subscribe on us community if yes type(y) or if not type(n)\n") | ||
thanks_s=("thank you for staying with us") | ||
would=("would you like to stay subscribe on us community? if yes type(y) or if not type(n) \n") | ||
|
||
message="""\ | ||
SUBJECT:Fragrance | ||
Best Smelling Fragrances & Colognes For Men : https://manofmany.com/fashion/mens-fragrances/best-perfume-fragrance-cologne-men | ||
Best Smelling Fragrances & Colognes For Women : https://www.goodhousekeeping.com/beauty-products/g28185044/best-perfume-for-women/ | ||
Thank you for registering on our community | ||
""" |