-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinsult.py
executable file
·112 lines (94 loc) · 1.99 KB
/
insult.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
110
111
112
#!/usr/bin/env python
# http://www.mandatory.com/2013/07/09/the-ultimate-insult-creator/
import sys
import os
import random
import string
def get_names():
name1 = [
"lazy",
"stupid",
"insecure",
"idiotic",
"slimy",
"slutty",
"pompus",
"communist",
"dicknose",
"pie-eating",
"racist",
"elitist",
"white trash",
"drug-loving",
"butterface",
"tone deaf",
"ugly",
]
name2 = [
"douche",
"ass",
"turd",
"rectum",
"butt",
"cock",
"shit",
"crotch",
"bitch"
"prick",
"slut",
"taint",
"fuck",
"dick",
"boner",
"shart",
"nut",
]
name3 = [
"pilot",
"canoe",
"captain",
"pirate",
"hammer",
"knob",
"box",
"jockey",
"nazi",
"waffle",
"goblin",
"biscuit",
"clown",
"socket",
"monster",
"hound",
"dragon",
]
return [name1, name2, name3]
if __name__ == "__main__":
#if 3 > len(sys.argv):
# print_usage()
# sys.exit(1)
names = get_names()
insult = []
for i, n in enumerate(names):
name_lbl = "NAME%d" % i
idx = 0
if name_lbl in os.environ:
idx = int(os.environ[name_lbl])
else:
idx = random.randint(0, len(n) - 1)
#sys.stderr.write(str(idx))
#sys.stderr.write(" ")
insult.append(n[idx % len(n)])
#sys.stderr.write("\n")
outsult = ""
if 1 == len(sys.argv):
outsult = " ".join(insult)
else:
outsult = " ".join(sys.argv[1:])
if -1 < string.find("aeiou", insult[0][0]):
outsult += " is an "
else:
outsult += " is a "
outsult += " ".join(insult)
outsult += "."
print outsult