Drag and drop onto Python script in Windows Explorer

前端 未结 6 990
予麋鹿
予麋鹿 2020-11-29 17:39

I would like to drag and drop my data file onto a Python script and have it process the file and generate output. The Python script accepts the name of the data file as a co

6条回答
  •  一向
    一向 (楼主)
    2020-11-29 18:11

    Create a shortcut of the file. In case you don't have python open .py files by default, go into the properties of the shortcut and edit the target of the shortcut to include the python version you're using. For example:

    Target: C:\Python26\python.exe < shortcut target path>

    I'm posting this because I didn't want to edit the Registry and the .bat workaround didn't work for me.

提交回复
热议问题