I want to build a class that perform various functions to the content(or lines) of any given file. I want to first include the opening and reading file function into that class, then add other methods.
Here is what I wrote for opening file and reading the lines:
self.name = name
self.filename = self.name
file1 = FileOpration("myfile.txt")
allines = file1.readAllline()
I define self.name variable because I want to store the specific file that I read. This works fine by the test code of print file1.filename. I saw "myfile.txt" on the terminal output.
However, the readAllline() method dose not work. The code only give me "None" as the output on terminal