Hello,
Yes, I am trying to open a txt file many times and read its contents. But, I am facing a typical problem.
My application is to sense the repeated pressing of a particular key of the keyboard. What I am doing is, each time I am sending a letter and writing to the txt file (response1.txt) and then trying to open the file in the read mode to read its contents.
When I am using these lines at the beginning of my program (outside all loops), I am being able to read the .txt file but, not its updated contents.
file5 = open('response1.txt', 'w')
file6 = open('response1.txt', 'r+')
When I am trying to close the file and open it within a loop such as :
while count<1:
vizact.onkeydown('e',InstructionScreenOFF) #Do an action on 'e' key press
yield viztask.waitTime(10)
file6 = open('response1.txt', 'r+')
I am getting the error message..................
TypeError: 'ActionData' object is not callable
Without opening the file .txt multiple times within the program, I cannot access its updated contents....and there I am getting into trouble.
If somebody can suggest me any solution for this.....it would be really helpful to me.
Thanks
Uttama
|