to write set of values to a file from python
Dennis.Benzinger at gmx.net
Wed Dec 14 20:28:30 CET 2005
muttu2244 at yahoo.com schrieb:
> hi everybody
> i want to write a set of values to a file from python.
> For ex:: the fields name will "comp name", "ip addr", "mac addr" etc.
> And below all these fields i ll have the values for these fields.
> it should look some what like this.
> comp name ipaddr macaddr
> jdasfhjashd 234.347.23.12
> dfdsfusdaufisa 234.533.45.12 188.8.131.523
> sfdidsfoui 184.108.40.206
> something like thiss.
> so which is the best way to do this.
> I mean which file format would be the best to choose , to dump all
> these values from my python script.
> Will it be a ".ini" file format? or ".xls" or ".txt" which will be the
> better one.
> so that later it will be easy for me to read this file.
> thanks in advance for the help
I would use a comma separated values (CSV) file.
Have a look at the csv module
More information about the Python-list