how to install pip install write2file how to use from write2file import write2file Create new file write2file(output_path,['header1', 'header2', '...', 'headern'], True) Write into existing file write2file(output_path, [content1,content2,...,contentn])