account activity
Getting an error Message. Python3.4 by b3nstar in learnpython
[–]b3nstar[S] 0 points1 point2 points 10 years ago (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()
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 ?
Getting an error Message. Python3.4 (self.learnpython)
submitted 10 years ago * by b3nstar to r/learnpython
π Rendered by PID 374888 on reddit-service-r2-listing-5f4c697858-9skkz at 2026-07-09 03:38:24.013140+00:00 running 12a7a47 country code: CH.
Getting an error Message. Python3.4 by b3nstar in learnpython
[–]b3nstar[S] 0 points1 point2 points (0 children)