excellent it works. tq
 

Date: Wed, 11 May 2011 14:58:39 +0100
Subject: Re: [Tutor] create an xls file using data from a txt file
From: wpr...@gmail.com
To: tc...@hotmail.com
CC: taxbot...@gmail.com; tutor@python.org




On 11 May 2011 14:34, tee chwee liong <tc...@hotmail.com> wrote:


hi all, 
 
thanks for this sharing. when i copy and run this code, i got this error:
 
Traceback (most recent call last):
  File "C:/Python25/myscript/excel/sampleexcel.py", line 1, in <module>
    import csv
  File "C:/Python25/myscript/excel\csv.py", line 3, in <module>
    w=csv.writer(open('output.csv','w'))
AttributeError: 'module' object has no attribute 'writer'



Well, reading the error message, it's saying that module "csv", coming from 
file "C:/Python25/myscript/excel\
csv.py" has no member "writer".  So, it seems you've called your test script 
(module) "csv" which effecitvely hid the standard python "csv" module.  

Try renaming your script file to something else ('testcsv.py' maybe) so its 
name doesn't conflict with the standard "csv" module and try again.

Walter
                                          
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to