Created
January 10, 2022 17:55
-
-
Save kreezxil/fac95424b1f04b7270df545c05ce6055 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySimpleGUI as sg | |
data = {} | |
def append(key, *array): | |
# format key which is appname or ssh | |
# + array which is 2 elements for non-ssh | |
# or 3 elements for ssh | |
# first element is the username | |
# second element is the password | |
# the 3rd element is the ip/address if it exists | |
data[key] = array | |
append("normal app", "[email protected]", "028i#mPoWU5D") | |
append("gaming login", "[email protected]", "7f%*3Qh1%@gF26") | |
append( | |
"ssh", | |
"remoteuser", | |
"akolGN34wrg7OxDp", | |
"address.of.server", | |
) | |
# just realized that I can't use the same key name for a bunch keys, silly me, but that's not what is causing my problem. Jan 10, 2022 | |
append( | |
"ssh2", | |
"remoteuser2", | |
"ncUNI124pH9714724", | |
"another.server.com", | |
) | |
# | |
# Make a window and ask if we need ssh | |
# if so format the window to handle that list | |
# return what is needed to the shell | |
# otherwise | |
# handle the list for non-ssh data | |
# | |
sg.theme("DarkAmber") | |
data_keys = list(data.keys()) | |
layout = [ | |
[sg.Text("Dictionary Data")], | |
[sg.Listbox(values=data_keys, size=(20, 12), key="-LIST-", enable_events=True)], | |
[sg.Button("Exit")], | |
] | |
window = sg.Window("Passwords & Shells", layout) | |
while True: | |
event, values = window.read() | |
if event == sg.WIN_CLOSED or event == "Exit": | |
break | |
# sg.popup(values['-LIST-']) | |
sg.popup(" KEY: {}\nVALUE: {}".format(values["-LIST-"], data.get(values["-LIST-"][0])), title="Dictionary Result") | |
window.close() | |
# still need to fix for working with autokey, now works by itself as is |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment