当我尝试运行脚本时出现此错误。
TypeError: 'builtin_function_or_method' object has no attribute '__getitem__'
这是脚本:
containerFile = open((tmpImageDirectory+"container.rvbr"), "r")
containedString = containerFile.read()
containerFile.close()
containedFiles = containedString .partition[","]
container.rvbr 包含一个带有多个逗号的字符串。如果执行这个str(conatinedString)
我得到这个<type 'str'>
,所以它是一个字符串。我想知道是否有人可以解释这个。