本文整理匯總了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]