本文整理汇总了Python中xlsxwriter.Workbook.filename方法的典型用法代码示例。如果您正苦于以下问题:Python Workbook.filename方法的具体用法?Python Workbook.filename怎么用?Python Workbook.filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xlsxwriter.Workbook
的用法示例。
在下文中一共展示了Workbook.filename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: action
# 需要导入模块: from xlsxwriter import Workbook [as 别名]
# 或者: from xlsxwriter.Workbook import filename [as 别名]
def action(args):
book = Workbook()
filetype = args.type
(infiles, ) = args.infiles
if filetype == 'Analysis':
tabs = ['0_QC', '1_QC_Metrics', '2_QC_by_Gene', '3_QC_by_Exon',
'4_SV_Gridss', '5_SV_Breakdancer', '6_SV_Pindel',
'7_CNV_Gene', '8_CNV_Exon', '9_Clinically_Flagged',
'10_SNP','11_INDEL', '12_MSI', '13_Amplicons', '14_PolyHunter']
# for each tab, find its file and process.
for tab in tabs:
try:
#Find file in infiles
sheet_name, fname = process_files(infiles, tab, filetype)
print sheet_name, fname
write_workbook(sheet_name, book, fname)
except TypeError:
print "Tab %s not processed" % tab
elif filetype == 'Combined':
for fname in infiles:
(f_path, f_name) = os.path.split(fname)
if re.search(str(filetype), f_name):
(f_short_name, f_extension) = os.path.splitext(f_name)
sheet_name = f_short_name.split('Combined_')
sheet_name = '_'.join(sheet_name[1:30])
print sheet_name, fname
write_workbook(sheet_name, book, fname)
book.filename=args.outfile
book.close()