将数据作为python程序的输出存储在excel文件中 [英] store data which is an output of python program in excel file

查看:508
本文介绍了将数据作为python程序的输出存储在excel文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ענת מאירה

0546515015

2016-07-25

בוטוקס ועיבוי שפתיים.

מחמוד אבו חב

0505178463

2016-07-25

מתעניין בעורך דין לכל מטרה.

אנעאם אבו חב

0542969636

2016-07-25

מתעניין בעורך דין לכל מטרה.

这是从python抓取中获得的输出,我想将其存储到excel/csv文件中,例如每行包含4列

this is an output got from python scrapping I want to store it into excel/csv file, such as each row contain 4 columns

例如

+-------------------------------------------------------+

| col 1 | col 2 | col 3 | col 4 |

|בוטוקס ועיבוי שפתיים|0546515015|2016-07-25"|ענת מאירה|

+------------------------------------------------------+

我该如何实现..? 请帮忙... 在此先感谢:)

how can I achieve it..? Please Help... Thanks in Advance :)

推荐答案

您可以在命令行上完成此操作

you could just do this on commandline

test.py>output.csv 

这会将所有数据放入一个csv文件中,然后可由excel读取

This will put all the data in a csv file which can then be read by excel

这篇关于将数据作为python程序的输出存储在excel文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆