csv_writer.py 文件源码

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

项目:PST-Go-Phish 作者: dpmforensics 项目源码 文件源码
def csv_writer(data, headers, output_directory, name=None):
    if name is None:
        name = "Go_Phish_Report.csv"

    if sys.version_info > (3, 0):
        with open(os.path.join(output_directory, name), "w", newline="") as csvfile:
            writer = csv.writer(csvfile)
            writer.writerow(headers)
            writer.writerows(data)
    else:
        try:
        import unicodecsv
        except ImportError:
        print("[+] Install the unicodecsv module to write the CSV report")
        sys.exit(1)

        with open(os.path.join(output_directory, name), "wb") as csvfile:
            writer = unicodecsv.writer(csvfile)
            writer.writerow(headers)
            writer.writerows(data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号