当前位置:   article > 正文

使用list(dict.keys())报错_unbound method dict.keys() needs an argument

unbound method dict.keys() needs an argument

平时使用list(dict.keys()),没有报错过,但是今天怎么运行都是报错,好奇怪啊,如下:

  1. list(action_data[0].keys())
  2. *** Error in argument: '(action_data[0].keys())'

从网上查了一下,看到一个说法是list的问题:

Commands that the debugger doesn’t recognize are assumed to be Python statements and are executed in the context of the program being debugged. Python statements can also be prefixed with an exclamation point (!).

所以改一下,在前面加一个"!",如:!list(action_data[0].keys()),就ok了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/217551
推荐阅读
相关标签
  

闽ICP备14008679号