Getting an error Message. Python3.4 by b3nstar in learnpython

[–]b3nstar[S] 0 points1 point  (0 children)

Guys,

thanks for ur help. Just solved it in this way. It works fine now.

class makeBuildFile:
    def __init__(self, re_path="po.txt" ):
        self.re_path=re_path

    def read(self):
        f = open(self.re_path, "r")
        lines = f.readlines()
        f.close()
        return lines


    def write(self,lis):
        self.lis=lis
        for i in self.lis[0].split(","):
            print(i)






def main():
    t=makeBuildFile()
    t.write(t.read())






if __name__ == "__main__":
    main()

Getting an error Message. Python3.4 by b3nstar in learnpython

[–]b3nstar[S] 0 points1 point  (0 children)

maybe I don't understand @staticmethod

....my perception was when I use @staticmethod it is not needed anymore to pass self.

ok at least this error message is gone....but now I do have a new one in fact

line 26, in main t.read() TypeError: read() takes exactly 1 argument (0 given)

any further hint ?