-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestingstill.py
More file actions
156 lines (119 loc) · 3.57 KB
/
testingstill.py
File metadata and controls
156 lines (119 loc) · 3.57 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
from ahk import AHK, Hotkey
import tkinter as tk
from tkinter import ttk
from tkinter import *
import webbrowser
import time
import tkinter.messagebox
ahk = AHK()
#ahk.run_script('Run Notepad') # Open notepad
#ahk.send_input('Hello`, World{!}')
#ahk.key_press('a')
#ahk.key_press('Tab')
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.key_press('Alt')
ahk.key_press('F')
win = ahk.find_window(title=b'Work-IB - Gmail - thinkingdrops - Mozilla Thunderbird') # Find the opened window
win.activate() # Give the window focus
#below is one
"""
tkWindow = Tk()
tkWindow.geometry('400x150')
tkWindow.title('PythonExamples.org - Tkinter Example')
def showMsg():
tkinter.messagebox.showinfo('Message', 'You clicked the Submit button!')
button = Button(tkWindow,
text = 'Submit',
command = showMsg)
button.pack()
tkWindow.mainloop()
"""
#above is one thing
# Create object
root = Tk()
# Adjust size
root.geometry( "200x200" )
# Change the label text
def show():
label.config( text = clicked.get() )
# Dropdown menu options
options = [
"Maryland - ECI",
"California - SVSP",
"Nevada - DOC",
"New York - ECF"
]
# datatype of menu text
clicked = StringVar()
# initial menu text
clicked.set( "Maryland - ECI" )
# Create Dropdown menu
drop = OptionMenu( root , clicked , *options )
drop.pack()
# Create button, it will change label text
button = Button( root , text = "click Me" , command = tester ).pack()
# Create Label
label = Label( root , text = " " )
label.pack()
# Execute tkinter
root.mainloop()
"""
LARGE_FONT= ("Verdana", 12)
NORM_FONT = ("Helvetica", 10)
SMALL_FONT = ("Helvetica", 8)
states = {
'MD' : 'www.google.com'
}
def popupmsg(msg):
popup = tk.Tk()
popup.wm_title("!")
label = ttk.Label(popup, text=msg, font=NORM_FONT)
label.pack(side="top", fill="x", pady=10)
B1 = ttk.Button(popup, text="Okay", command = popup.destroy)
B1.pack()
popup.after(3000, lambda: popup.destroy())
popup.mainloop()
#command = lambda: popupmsg("popup message here!"))
def find_state():
entry = e1.get()
if entry not in states:
e1.delete(0, tk.END)
msg = "Sorry, state not found. Enter abbreviation as 2 letter capitals only."
popupmsg(msg)
master.quit()
else:
state = e1.get()
url = states.get(state)
webbrowser.open(url, new=0, autoraise=True)
e1.delete(0, tk.END)
master = tk.Tk()
tk.Label(master,
text="Which state are you looking for? Enter 2-letter abbreviation, ie MD").grid(row=0)
e1 = tk.Entry(master)
e1.grid(row=0, column=1)
def process(event=None):
find_state()
e1.bind('<Return>', process)
tk.Button(master,
text='Quit',
command=master.quit).grid(row=3,
column=0,
sticky=tk.W,
pady=4)
tk.Button(master,
text='Press Enter to Find State Info', command=find_state).grid(row=3,
column=1,
sticky=tk.W,
pady=4)
tk.mainloop()
----
key_combo = '#n' # Define an AutoHotkey key combonation
script = 'Run Notepad' # Define an ahk script
hotkey = Hotkey(ahk, key_combo, script) # Create Hotkey
hotkey.start() # Start listening for hotkey
"""