-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDictionaryMaker.py
More file actions
41 lines (37 loc) · 1.34 KB
/
Copy pathDictionaryMaker.py
File metadata and controls
41 lines (37 loc) · 1.34 KB
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
__author__ = 'Charlie'
import requests
import win32api as w
def addToList(input):
thing = input.upper()
w.WriteProfileVal("Heap", thing, 1, "E:\Program Files\Pycharm\Projects\\Dict.moo")
word_site = "http://www.mieliestronk.com/corncob_caps.txt"
response = requests.get(word_site)
words = response.content.splitlines()
wordlist = []
wordheap = ""
for i in range(0, len(words)):
word = str(words[i])[2: -1].upper()
#already = w.GetProfileVal("Heap", word, "&&&", "E:\Program Files\Pycharm\Projects\\Dict.moo") == 1
#if not already:
# addToList(word)
wordlist.append(word)
wordheap += word
wordheap += "\n"
while True:
conds = input("Input a comma-separated search condition\n>> ").replace(" ", "")
fits = wordlist
if conds[0] == "!":
checks = conds[1: len(conds)].upper().split(",")
for j in range(0, len(checks)):
check = checks[j]
if fits.count(check) > 0:
print("Yes, %s is a word or phrase" % check)
else:
print("No, %s isn't a word or phrase (so far as we know)" % check)
else:
conds = conds.split(",")
for i in range(0, len(conds)):
cond = conds[i].upper()
if cond != "":
fits = [fits[j] for j in range(0, len(fits)) if fits[j].count(cond) > 0]
print(fits)