-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtester3a..py
More file actions
123 lines (94 loc) · 3.08 KB
/
tester3a..py
File metadata and controls
123 lines (94 loc) · 3.08 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
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
113
114
115
116
117
118
119
120
121
122
123
from ahk import AHK, Hotkey
import tkinter as tk
from tkinter import ttk
from tkinter import *
import webbrowser
import time
import tkinter.messagebox
import keyboard
ahk = AHK()
prisonInfo = {'MD': {'PrisonName':['Street', 'Zip']},
'NY': {"Prison2Name":['Street2', 'Zip2']}}
people = {'MD': {'name': 'John', 'age': '27', 'sex': 'Male'},
'NY': {'name': 'Marie', 'age': '22', 'sex': 'Female'}}
states = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
print(people)
print(prisonInfo['NY']['Prison2Name'])
#val = input("state?")
#val2 = input("prison?")
people1 = {1: {'Name': 'John', 'Age': '27', 'Sex': 'Male'},
2: {'Name': 'Marie', 'Age': '22', 'Sex': 'Female'}}
for st, prison in prisonInfo.items():
print("\nState:", st)
for key in prison:
print(key + ':', prison[key])
def tester():
win = list(ahk.windows())
print(win)
for window in ahk.windows():
print(window.title) #this will list names of open windows
ahk.run_script('Run Notepad') # Open notepad
ahk.type("this is a test run")
keyboard.write('The quick brown fox jumps over the lazy dog.')
keyboard.write(prisonInfo[state][prison][0]) #this enters street addr
keyboard.write(prisonInfo[state][prison][1]) #this enters zip code
#keyboard.send('alt+f')
#ahk.type(prisonInfo[state][prison])
#ahk.key_press('Alt')
#ahk.key_press('F')
#win = ahk.find_window(title=b'Gmail - thinkingdrops - Mozilla Thunderbird') # Find the opened window
#win.activate() # Give the window focus
def keys_exists(element, *keys):
'''
Check if *keys (nested) exists in `element` (dict).
'''
if not isinstance(element, dict):
raise AttributeError('keys_exists() expects dict as first argument.')
if len(keys) == 0:
raise AttributeError('keys_exists() expects at least two arguments, one given.')
_element = element
for key in keys:
try:
_element = _element[key]
except KeyError:
return False
return True
state = input("state?")
prison = input("prison?")
#print(keys_exists(prisonInfo, "MD", "Prison2"))
if keys_exists(prisonInfo, state, prison) == True:
tester()
else:
print("no bueno")
"""
for p_id, p_info in people1.items():
print("\nPerson ID:", p_id)
for key in p_info:
print(key + ':', p_info[key])
"""
#if val in States:
#print("cool")
#print(States[val][val2])
"""
if val2 in States:
print("okey coolier")
else:
print("what is dis")
"""
"""
val = input("Enter your value: ")
print(val)
if val in States:
print("Excellent")
val2 = input("enter prison name?")
if val2 in States[val]:
print(States[val[val2]])
else:
print("sorry not good enough")
else:
print("sorry dude")
"""