In python open() function basically needs 3 parametres: filename,mode and encoding. You have specified the filename but you still need to specify the mode. There are many modes but you will basically need 3 of them:
"w" ->(write mode) creates file and if file exists creates empty file
"a" ->(append mode) creates file and if file exists appends new data to previous data
"r" ->(read mode) reads precreated file.
and encoding parametre is for seeing the chracters correct:
ascii -> for english alphabet
utf-8 -> for most of the langugages in the world (use this)
So all in all you should use open function like this choose which fits your purpose:
fp=open("filename.txt","w",encoding="utf-8")
fp=open("filename.txt","a",encoding="utf-8")
fp=open("filename.txt","r",encoding="utf-8")