-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject_script.py
29 lines (22 loc) · 1.19 KB
/
project_script.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
from random import choice
from string import ascii_lowercase as letters
list_of_domains = ['yaexample.com','goexample.com','example.com']
quotes = [ 'Luck is what happens when preparation meets opportunity',
'All cruelty springs from weakness',
'Begin at once to live, and count each separate day as a separate life',
'Throw me to the wolves and I will return leading the pack']
def generate_name(length_of_name):
return ''.join(choice(letters) for i in range(length_of_name))
def get_domain(list_of_domains):
return choice(list_of_domains)
def get_quotes(list_of_quotes):
return choice(list_of_quotes)
def generate_records(length_of_name, list_of_domains, total_records, list_of_quotes):
with open("./data.txt", "w") as to_write:
for num in range(total_records):
key = generate_name(length_of_name)+"@"+get_domain(list_of_domains)
value = get_quotes(quotes)
to_write.write(key + ":" + value + "\n")
to_write.write("[email protected]:Don't let me leave Murph\n")
to_write.write("[email protected]:All I do is win win win no matter what!\n")
generate_records(10, list_of_domains, 199, quotes)