Last active
December 31, 2018 15:26
-
-
Save greinacker/846ab2a3ce6546733b13 to your computer and use it in GitHub Desktop.
Workflow/Pythonista samples for saving/retrieving from keychain
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
# coding: utf-8 | |
import sys | |
import keychain | |
import clipboard | |
import webbrowser | |
key = sys.argv[1] | |
value = keychain.get_password("workflow", key) | |
if value != None: | |
clipboard.set(value) | |
else: | |
clipboard.set("") | |
webbrowser.open("workflow://") |
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
# coding: utf-8 | |
import sys | |
import keychain | |
import webbrowser | |
key = sys.argv[1] | |
value = sys.argv[2] | |
keychain.set_password("workflow",key,value) | |
webbrowser.open("workflow://") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good example thanks!