-
Notifications
You must be signed in to change notification settings - Fork 0
/
random_email_gen.py
63 lines (44 loc) · 1.3 KB
/
random_email_gen.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
import random
import string
import csv
import progressbar
def getcount():
rownums = int(input("How many email do you want?: "))
try:
rowint = int(rownums)
return rowint
except ValueError:
print("Please enter an integer value")
return getcount()
def makeEmail():
extensions = ['com', 'net', 'org', 'gov']
domains = [
'gmail', 'yahoo', 'comcast', 'verizon', 'morocco', 'hotmail',
'outlook', 'ma'
]
winext = extensions[random.randint(0, len(extensions) - 1)]
windom = domains[random.randint(0, len(domains) - 1)]
acclen = random.randint(1, 20)
winacc = ''.join(
random.choice(string.ascii_lowercase + string.digits)
for _ in range(acclen))
finale = winacc + "@" + windom + "." + winext
return finale
#save count to var
howmany = getcount()
#counter for While loop
counter = 0
#empty array for loop
emailarray = []
#uses counter to figure out how many emails to keep making
print("Creating email addresses...")
print("Progress: ")
prebar = progressbar.ProgressBar(maxval=int(howmany))
for i in prebar(range(howmany)):
while counter < howmany:
emailarray.append(str(makeEmail()))
counter = counter + 1
prebar.update(i)
print("Creation completed.")
for i in emailarray:
print(i)