Once you have created a set of Python shortcuts you use on a daily basis, you can use the built in Tkinter Python library to build your own GUI to click buttons, initilizaing your codes.
You can see each shortcut script in this repository: https://github.com/danajsalk/Python-shorcuts
This GUI has some fun features like color options and attributes that keep it on the topmost level at all times. This is very useful when you are clicking back and forth from a SQL windows or Excel sheet. You can easily add or edit functions to create your own version of Python Shortcuts.
You can pick other colors here: http://color-picker.appsmaster.co/#00FF7B
TKinter functions: https://docs.python.org/3/library/tkinter.html
When the scripts are run, they directly access values copied to your clipboard.
-
Double click on python file to open TKinter window
-
Copy values to clipboard
-
Click on shortcut button to execute code
-
Paste new string
Below are some examaples of the inputs and outputs for the shortcuts.
Shortcut | Input | Output |
---|---|---|
Comma Shortcut | apples apples oranges bananas |
apples, oranges, bananas |
Tick Shortcut | apples apples oranges bananas |
'apples', 'oranges', 'bananas' |
Tick a Comma | apples, oranges, bananas | 'apples', 'oranges', 'bananas' |
Remove Duplicates | apples apples oranges bananas |
apples oranges bananas |
See file "tkinter_application_new_button.py"
- Define a new function for the button to activate
def newCommand():
setClip("""Testing your new button!""")
- Add button to queryFrame
queryFrame = the section the button will appear in
newButton = Button(queryFrame, text="Your New Button Text", command=newCommand)
newButton.pack(fill=X)