I have a project where the goal is to have a user double click on an xml file, which is sent to my python script to work with. What is the best way to do accomplish something like this? Can this even be done programmatically or is this some kind of system preference I have to modify? How can my program retrieve the file that was double clicked on (at least the name).
This problem is a bit underspecified.
Say, you're on some Windows: You could assign the correct python invocation as default open action to the .xml file type, but this would then apply to all .xml files. And you might need elevated access rights to perform the change.
On Linux, you'd have to deal with various ways of desktop environments ... and then I'd open an issue because it does not work with xfe running under awesome on my box here.
In short: Solve this problem by avoiding it.
Can you make do with "drag this file onto the application icon"?
Can you make the .xml files appear in a dedicated place and have a background task check for new ones?
Execute Python when double clicking a file