pdf :
response = self.multi_requests(url=str(pdf_url))
reader = PdfFileReader(io.BytesIO(response.content))
writer = PdfFileWriter()
page_count = reader.getNumPages()
for i in range(1, page_count):
writer.addPage(reader.getPage(i))
fw = io.BytesIO()
writer.write(fw)
fw.flush()
fw.getvalue() 这个值就是二进制
dataframe:
io.StringIO(out_df.to_csv()).read()
标签:文件,转换,fw,二进制,writer,io,reader,BytesIO From: https://www.cnblogs.com/avivi/p/16895902.html