简而言之,我使用一个xlsx文件,并在使用print dir(alist)
get blank属性检查一些列表时。你知道吗
neglist = neglist.tolist()
此时我想检查evth是否正常:
def check_variab (variab):
print "The type is %s" % type(variab)
print "Its length = %i" % len(variab)
print "Its attributes are:" % dir(variab)
print 'neglist'
check_variab(neglist)
但我得到的是:
type: list
length: 19
attributes:
没有属性打印,虽然类型是列表的权利,其长度和内容是确定的。你知道吗
有人能解释为什么会这样吗?你知道吗
您忘了使用
%s
占位符,因此不会对任何内容进行插值。添加%s
或%r
:如果没有占位符,您将看不到任何内容,事实上:
您想在列表上使用standard sequence operations。你知道吗
相关问题 更多 >
编程相关推荐