我实际上正在学习python3,但无法弄清楚为什么会这样
class Load():
def __init__(self):
print("Starting Now")
self.player = []
def player_Stats(self,filename):
with open(filename) as my_names:
names = my_names.readlines()
for one in names:
one.replace("\n","")
self.player.append(one.split[":"][0])
print(player)
print(Load.player_Stats("players.txt"))
它给了我一个错误
Traceback (most recent call last):
File "test.py", line 56, in <module>
print(Load.player_Stats("players.txt"))
TypeError: player_Stats() missing 1 required positional argument: 'filename'
我不明白为什么。