Thank you
Dead_Eye. I wrote a code just as he said and
I selected my python script as the default for txt files.
this is my python code
1 2 3 |
import sys
file = open (sys.argv[ 1 ], "r" )
print ( file .read())
|
When I dragged a txt file and dropped it over my python script, the python script reads the text file successfully.
But when I double clicked on the txt file, then it shows following error msg
Error:
C:Users\Kavindu\Documents\python_workspace\a2.txt is not a valid Win32 application
What is the reason for this error msg, and how to solve this problem.
I need to open txt files with my python script by clicking on text files
plz can someone help me with this