Jul-06-2018, 06:28 PM
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
plz can someone help me with this
this is my python code
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 filesplz can someone help me with this
![Cry Cry](https://python-forum.io/images/smilies/cry.png)