Google Groups Home
Help | Sign in
csv writerows
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Seweryn Habdank-Wojewódzki  
View profile
 More options May 8, 1:50 am
Newsgroups: pl.comp.lang.python
From: Seweryn Habdank-Wojewódzki <habd...@gmail.com>
Date: Wed, 7 May 2008 22:50:52 -0700 (PDT)
Local: Thurs, May 8 2008 1:50 am
Subject: csv writerows
Witam

W module csv jest funkcja write rows ona rzada podania sekwencji
(posiada funkcje .next()).
Ale jest problem w pythonie 2.5 mam nastepujace wyniki (negatywne):

>>> f = [1,2,3,4,5]
>>> import csv
>>> writer = csv.writer(open('test1.txt','w'), delimiter='\t')
>>> writer.writerows(f)

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    writer.writerows(f)
Error: sequence expected

Jak zatem zamienic liste na sekwencje?
Albo jak uzyc tego "writerows" (pewnie robie jakis blad) :-).

Pozdrawiam,
Seweryn Habdank-Wojewodzki


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Seweryn Habdank-Wojewódzki  
View profile
 More options May 8, 2:02 am
Newsgroups: pl.comp.lang.python
From: Seweryn Habdank-Wojewódzki <habd...@gmail.com>
Date: Wed, 7 May 2008 23:02:42 -0700 (PDT)
Local: Thurs, May 8 2008 2:02 am
Subject: Re: csv writerows
Witam

Problem rozwiazany :-)

> >>> f = [1,2,3,4,5]

f = [[1,2,3],[2,4,5],[3,4,5]]

f ma byc sekwencja sekwencji, a nie tylko sekwencja.

witeROW zapisuje linijke, a writeROWS calosc.

Pozdrawiam,
Seweryn Habdank-Wojewodzki


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google