Namedtuple在windows解释器上没有定义 [关闭] 。

问题描述 投票:0回答:1

我正试图按照以下的使用例子来做 namedtuple( )文件但是,我一直得到 namedtuple is not defined.

Traceback

python tuples traceback namedtuple
1个回答
2
投票

你需要 import collections 在上面,然后你可以做 collections.namedtuple

你也可以做 from collections import namedtuple 它应该像文档中那样工作

© www.soinside.com 2019 - 2024. All rights reserved.