本文整理汇总了Python中IOTools.readList方法的典型用法代码示例。如果您正苦于以下问题:Python IOTools.readList方法的具体用法?Python IOTools.readList怎么用?Python IOTools.readList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOTools
的用法示例。
在下文中一共展示了IOTools.readList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: import IOTools [as 别名]
# 或者: from IOTools import readList [as 别名]
if len(args) < 2:
raise ValueError( "please supply at least two filenames.")
headers, titles, sets = [], [], []
if options.headers:
if options.headers == "-":
headers=args
else:
headers=options.headers.split(",")
if len(headers) != len(args):
raise ValueError ("please supply the same number of headers as there are filenames." )
for f in args:
if options.with_title:
title, data = IOTools.readList( open(f,"r"), with_title = options.with_title )
titles.append( title )
else:
data = IOTools.readList( open(f,"r") )
sets.append( set( data ))
if not headers and titles:
headers = titles
else:
headers = args
for x in range(len(sets)-1):
set1=sets[x]
for y in range(x+1, len(sets)):
set2=sets[y]