Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
re_sit4006/management.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
36 lines (36 sloc)
3.21 KB
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
def management(): | |
from data import check_mail #import the function from file data | |
from data import delete_mail #import the function from file data | |
from data import write_mail #import the function from file data | |
from data import read_the_data_base #import the function from file data | |
from data import sender #import the function from file data | |
from printers import start #import the variable from the file printers | |
from printers import would #import the variable from the file printers | |
from printers import would2 #import the variable from the file printers | |
from printers import thanks_y #import the variable from the file printers | |
from printers import thanks_n #import the variable from the file printers | |
from printers import thanks_s #import the variable from the file printers | |
from printers import subscribe #import the variable from the file printers | |
from printers import subscribe2 #import the variable from the file printers | |
c=input(start)#will ask the user to type the E-mail also will print the variable start from the file printers | |
if check_mail(c)==True:#will call the fuction check_mail with parameter c(input by user) | |
s=input(would)#will ask the user to if would like to stay subscribe or not and will print the variable would from the file printers | |
while s!="y" and s!="Y" and s!="n" and s!="N":#will check that the user typed the correct letter | |
s=input(would2)#will again ask the user to if would like to stay subscribe or not and will print the variable would2 from the file printers | |
if s=="y"or s=="Y":#will check the answer of the user is "y"or "Y" for yes | |
print(thanks_s)#will print the variable thanks_s from the file printers | |
sender(c)#will call the fuction sender with parameter c(input by user), will send the E-mail | |
elif s=="n"or s=="N":#will check the answer of the user is "n"or "N" for no | |
delete_mail(c)#will call the fuction delete_mail with parameter c(input by user),will delete the element from the file mails.txt | |
print(thanks_n)#will print the variable thanks_n from the file printers | |
else: | |
sub=input(subscribe)#will ask the user to if would like to subscribe or not and will print the variable subscribe from the file printers | |
while sub!="y" and sub!="Y" and sub!="n" and sub!="N":#will check that the user typed the correct letter | |
sub=input(subscribe2)#will again ask the user to if would like to subscribe or not and will print the subscribe2 would2 from the file printers | |
if sub=="y"or sub=="Y":#will check the answer of the user is "y"or "Y" for yes | |
print(thanks_y)#will print the variable thanks_y from the file printers | |
write_mail(c)#will call the fuction write_mail with parameter c(input by user),will write the mail in the file from the file mails.txt | |
sender(c)#will call the fuction sender with parameter c(input by user), will send the E-mail | |
if sub=="n"or sub=="N":#will check the answer of the user is "n"or "N" for no | |
print(thanks_n)#will print the variable thanks_n from the file printers | |
read_the_data_base()#will print all the E-mails from the database(file mails.txt) |