IonTorrent_summary_table.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:reportIT 作者: stevekm 项目源码 文件源码
def py_gunzip(gz_file, outdir = "."):
    # extract a .gz file
    # read in the contents
    print gz_file
    print outdir
    print "Reading file:\t" + gz_file
    input_file = gzip.GzipFile(gz_file, 'rb')
    file_contents = input_file.read()
    input_file.close()
    print "Finished reading file"
    # get the output path from the outdir and filename
    output_file_base = os.path.basename(os.path.splitext(gz_file)[0])
    print output_file_base
    output_file_path = os.path.join(outdir, output_file_base)
    print output_file_path
    # write the contents
    print "Writing contents to file:\t" + output_file_path
    print type(output_file_path)
    # output_file = file(output_file_path, 'wb')
    output_file = open(output_file_path, 'wb')
    output_file.write(file_contents)
    output_file.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号