You want to associate text files extension with a Python program?
This is possible, but I think it's not a good idea to open all text files generally with Python.
Then you read with
Then you can do what you want with the path.
This is possible, but I think it's not a good idea to open all text files generally with Python.
- Associate the extension .txt to 'py C:\windows\your_script.py'
- Clicking now on a .txt file should call following: 'py C:\windows\your_script.py filename.txt'
Then you read with
sys.argv[1]
the first argument from the commandline.sys.argv[0]
is the python-script.Then you can do what you want with the path.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!