Last active
November 1, 2020 07:09
-
-
Save WirlyWirly/5b3635a4b70a08499543c375752b393f to your computer and use it in GitHub Desktop.
How to create drag and drop functionality for python files
This file contains 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
If you're on windows, have python installed, and would like to be able to drag-and-drop files on-top of python scripts (.py/.pyw files), this will show you how to set that up. | |
! Make sure python is in your path otherwise this won't work | |
1) Create a shortcut for the .py file: Hold alt while you drag the file | |
2) Right-click on the shortcut and open its properties | |
3) In the 'Target' field, add the word 'Python' (no quotes) to the very beggining of the line: Make sure you don't edit/delete the part that was already there. Press OK. | |
ex: python "C:\Path\to\Python_file.py" | |
4) Drag-and-drop your items on-top of this shortcut and the script will process them | |
Optionally, you can add this shortcut it to your send-to folder, which will give you access to it from your context menu. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment