On Thu, Aug 15, 2013 at 10:33 AM, Joug Raw <[email protected]> wrote:
> class FileOpration:
> def __init__(self,name):
> self.name = name
> self.filename = self.name
> def readAllline(self):
> open(self.name).readlines()
>
> file1 = FileOpration("myfile.txt")
> print file1.filename
> allines = file1.readAllline()
You probably want to return that value:
def readAllline(self):
return open(self.name).readlines()
Then it'll do what you expect. But why wrap this up in a class? Why
not simply call the underlying functions directly?
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list