使用list(dict.keys())报错

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

list(action_data[0].keys())
*** 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了。

你可能感兴趣的:(报错,python)