-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
109 lines (75 loc) · 3.53 KB
/
main.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import os, pyfiglet
import sys
from colorama import Fore , Style
import random
all_col= [Style.BRIGHT+Fore.RED,Style.BRIGHT+Fore.CYAN,Style.BRIGHT+Fore.LIGHTCYAN_EX, Style.BRIGHT+Fore.LIGHTBLUE_EX, Style.BRIGHT+Fore.LIGHTCYAN_EX,Style.BRIGHT+Fore.LIGHTMAGENTA_EX,Style.BRIGHT+Fore.LIGHTYELLOW_EX]
ran = random.choice(all_col)
def banner():
os.system("clear")
print(ran, pyfiglet.figlet_format("\tPrivate\n\tBook"))
print(Style.BRIGHT + Fore.LIGHTCYAN_EX, "\n", "- " * 4, " [+] Follow me on Instagram @cyber_dioxide ", "- " * 4)
print(Style.BRIGHT + Fore.LIGHTYELLOW_EX, "\n", "- " * 4, " [+] Follow me on Instagram @cyber_dioxide_ ", "- " * 4)
print(Style.BRIGHT + Fore.LIGHTRED_EX, "\n", "- " * 4, "[+] Github: https://github.com/Cyber-Dioxide/ ", "- " * 3)
banner()
def exit():
sys.exit()
my_dict = {}
def add_cont():
name = input(ran + "\nType name for the number: ")
num = input(ran + "\nType Phone number: ")
comf = input(ran + "\nDo you want to add more info? [y/n]:")
if comf == "y":
email = input(ran + "\nEnter email address: ")
nickname = input(ran +"\nType nickname for the contact: ")
company = input(ran +"\nEnter company name: ")
accounts = input(ran + "\nType other Social Media accounts: ")
file = open("contacts.txt", "a+")
file.write("\nName: " + name + f"\nPhone Number: {num} "+"\nEmail: "+email+"\nCompany: "+company + "\nAccounts: "+accounts+"\nNickname: "+nickname)
file.write("\n" + "- " * 10)
print(ran + "\n\n\tAdded Successfully!\n")
print(Fore.CYAN + "\nExit the tool! Type 'nano contacts.txt' to see saved contacts! :-)")
else:
file = open("contacts.txt", "a+")
file.write("\nName: " + name + f"\nPhone Number: {num} ")
file.write("\n" + "- " * 10)
print(ran + "\n\n\tAdded Successfully!\n")
print(Fore.LIGHTMAGENTA_EX + "\nExit the tool! Type 'nano contacts.txt' to see saved contacts! :-)")
l = {name: num}
my_dict.update(l)
pass
def del_cont():
name = input(ran + "\nType name of the number: ")
with open("contacts.txt") as file:
all_contacts =file.readlines()
for contacts in all_contacts:
if name in contacts:
all_contacts.remove(contacts)
print(ran+"\nDeleted Successfully!\n")
def view():
file = open("contacts.txt" , "r")
read = file.read()
print(ran + "\n\t\tThis is what i found: \n")
print(ran + read)
cont =" "
while cont != "n" and "no":
print(ran + "\n\t\t[1] Add Contact\n\t\t[2] Delete Contact\n\t\t[3] View Contatct\n\t\t[4] Exit\n ")
choice = input(ran + "Enter your choice: ")
if choice == "1":
add_cont()
elif choice == "2":
del_cont()
elif choice == "3":
view()
elif choice == "4":
print(ran + "\n\tDont Forget to do following tasks :-)\t\n")
print(Style.BRIGHT + Fore.LIGHTCYAN_EX, "\n", "- " * 4, " [+] Follow me on Instagram @cyber_dioxide ", "- " * 4)
print(Style.BRIGHT + Fore.LIGHTYELLOW_EX, "\n", "- " * 4, " [+] Follow me on Instagram @cyber_dioxide_ ", "- " * 4)
print(Style.BRIGHT + Fore.LIGHTRED_EX, "\n", "- " * 4, "[+] Github: https://github.com/Cyber-Dioxide/ ", "- " * 3)
exit()
else:
print(ran + "\nInvalid option")
exit()
cont = input(ran + "\nDo you want to continue? [y/n]:")
if cont == "y":
os.system("clear")
banner()