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