I don't have a clue on where to look for a solution to this. Basically i want to make a file that can be "opened with" a python script. The directory of the opened file will be stored as a variable in the script. Here's what I mean by "Open With": 
Sorry if I'm not too good at describing this.
There might be a more direct way, but one approach could be to write a simple batch file that invokes the Python interpreter with your script:
main.bat
@echo off
python main.py %1
Add absolute or relative paths if necessary.
Within main.py, the name of the file should then be available as sys.argv[1].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With