gpt4 book ai didi

python - 类型错误 : str object is not callable

转载 作者:太空宇宙 更新时间:2023-11-04 08:18:49 27 4
gpt4 key购买 nike

这是我的代码:

fi=tarfile.open(os.path.join(pathin,file_in),'r')
list-fi.getmembers()
entries_list[]
for lis in list:
name_list=lis.name()
entries_list.append(name_list)
print entries_list.

name_list=lis.name() 行,我收到错误 str object is not callable。你能解释一下为什么吗?

提前致谢。

最佳答案

lis.name 是一个字符串,所以 lis.name() 尝试调用这个字符串。因为字符串不可调用,所以您会收到错误消息 str object is not callable

关于python - 类型错误 : str object is not callable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9570593/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com