I am writing a simple Python script with no GUI. I want to be able to drag and drop multiple files onto my python script and have access to their absolute paths inside of the script. How do I do this in Mac, Linux, and windows? For times sake, just Mac will be fine for now.
I've googled this question and only found one related one but it was too confusing. I am currently running Mac OS X Snow Leopard.
Any help is much appreciated.
Thanks!
解决方案
For OS X, the most straightforward way is to have your script run as part of an application bundle (.app). You can use something like py2app to build a python application. Another approach might be to use Automator or AppleScript to create an app that takes the input parameters and passes them to the python script. An example of Automator usage is here.