Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/286.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 类型错误:';功能';对象没有属性'__获取项目';55_Python_Python 2.7 - Fatal编程技术网

Python 类型错误:';功能';对象没有属性'__获取项目';55

Python 类型错误:';功能';对象没有属性'__获取项目';55,python,python-2.7,Python,Python 2.7,下面的代码将不会加入,调试时,该命令不会存储整个路径,而只是给出错误类型error:“function”对象没有属性“getitem” try: appdata = os.path.expandvars("%AppData%") config = import_cfg('config', os.path.join[appdata, 'identities', 'sun']) config_loaded = True 不使用方括号调用函数。试试括号 config = im

下面的代码将不会加入,调试时,该命令不会存储整个路径,而只是给出错误类型error:“function”对象没有属性“getitem

try:
    appdata = os.path.expandvars("%AppData%")
    config = import_cfg('config', os.path.join[appdata, 'identities', 'sun'])
    config_loaded = True
不使用方括号调用函数。试试括号

config = import_cfg('config', os.path.join(appdata, 'identities', 'sun'))
config = import_cfg('config', os.path.join(appdata, 'identities', 'sun'))