You cannot search directly through a file for a String; you must first convert to a string. Also, you are opening the file in a
mode, which is write-only, so try something like this:
C1 = open("Class1.txt","r")
dataList = C1.readlines()
data = ""
for line in dataList:
data += line
C1.close()
# do stuff with data, which is a string
Other Notes:
I do not recommend having a space
in your file name; rename it to Class.txt
as in my example.
To .find(something)
, something
must be a string, like: data.find("S_N")