Re: to write set of values to a file from python

2005-12-16 Thread Murtog (sent by Nabble.com)
muttu, just as an advice, in cases like this using the KirbyBase module is a better choice(IMHO): http://www.netpromi.com/kirbybase.html it should make easier your work =]. cheers Sent from the Python - python-list forum at Nabble.com: Re: to write set of values to a file from python -- http

Re: to write set of values to a file from python

2005-12-16 Thread Scott David Daniels
Scott David Daniels wrote: > > def lagged(source): > '''produce element,islast for elements in source''' > generator = iter(source) > previous = generator.next() > for element in generator: > yield previous, False > yield previous, True Oops

Re: to write set of values to a file from python

2005-12-16 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > hi > thanks every body for the help. > Now how can check whtr the row am reading is the last row or not?? > > for example: ... > reader = csv.reader(file) > for row in reader: > print row > HERE HOW CAN I CHECK WHTR THIS ROW IS THE LAST ONE IN THE FILE > > s

Re: to write set of values to a file from python

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > hi > thanks every body for the help. > > Now how can check whtr the row am reading is the last row or not?? > > for example for this below data in csv file > > CompName,IpAddr,MacAddr > XXX,192.178.23.11,78.23.34.23.12 > YYY,192.189.22.11,89.23.43.12.34 > ZZZ,192.17

Re: to write set of values to a file from python

2005-12-15 Thread muttu2244
hi thanks every body for the help. Now how can check whtr the row am reading is the last row or not?? for example for this below data in csv file CompName,IpAddr,MacAddr XXX,192.178.23.11,78.23.34.23.12 YYY,192.189.22.11,89.23.43.12.34 ZZZ,192.179.24.45,89.23.34.12.45 file = open ('C:\some.c

Re: to write set of values to a file from python

2005-12-14 Thread Bengt Richter
On 14 Dec 2005 15:39:02 -0800, [EMAIL PROTECTED] wrote: >thanks lawrence >it did work. >and i have one more question for you > >its printing the feilds name in the following way > >CompName >IpAddr >MacAddr > >that means each row its printing one field name, can i make it to print >each one of the

Re: to write set of values to a file from python

2005-12-14 Thread muttu2244
thanks lawrence it did work. and i have one more question for you its printing the feilds name in the following way CompName IpAddr MacAddr that means each row its printing one field name, can i make it to print each one of the field in different columns, in this way CompName

Re: to write set of values to a file from python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I have tried with the following code > > import csv > file = open("some.csv","wb") > writer = csv.writer(file) > list = ["CompName", "IpAddr", "MacAddr","OpSys"] > for row in list: > writer.writerow(row) > > file.close() writer

Re: to write set of values to a file from python

2005-12-14 Thread muttu2244
I have tried with the following code import csv file = open("some.csv","wb") writer = csv.writer(file) list = ["CompName", "IpAddr", "MacAddr","OpSys"] for row in list: writer.writerow(row) file.close() And the result am getting in a "some.csv" file is as below c o m p N a m e I

Re: to write set of values to a file from python

2005-12-14 Thread Dennis Benzinger
[EMAIL PROTECTED] schrieb: > [...] > its printing each character in a seperate row where as > i wanteach string in a seperate column? > > so how can i do that?? Any help for this. > [...] Could you post your code here? Or explain what you did exactly. Bye, Dennis -- http://mail.python.o

Re: to write set of values to a file from python

2005-12-14 Thread muttu2244
hi dennis, thanks for the help, itseems its good way to go. i tried it, and i liked the idea, but there is one problem with it. its printing each character in a seperate row where as i wanteach string in a seperate column? so how can i do that?? Any help for this. thanks and regards yogi

Re: to write set of values to a file from python

2005-12-14 Thread Dennis Benzinger
[EMAIL PROTECTED] 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

to write set of values to a file from python

2005-12-14 Thread muttu2244
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