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
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
[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
[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
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
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
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
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
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
[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
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
[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
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
13 matches
Mail list logo