non e' che banalmente non trova il file.csv ?

Il 22/02/2013 10:00, emmanuel segura ha scritto:
Ciao a tutti la lista

Sto provando a imparare python, ho fatto questo piccolo script leggendo la documentazione Se faccio tutti gli steps dalla shell di python, non ricevo nessun errore, invece se lo lancio con ./csv.py va in error e anche se lo lancio con python csv.py

Come distro Linux sto usando debian 6.06 con Python 2.6.6
=========================================================================
#!/usr/bin/python

try:
        import csv
except ImportError:
        print "Error loading csv module"

fd = open("test.csv","rb")
cs = csv.reader(fd)

for row in cs:
        print ','.join(row)
============================================================================

Output error

=====================================================================================
Traceback (most recent call last):
  File "./csv.py", line 4, in <module>
    import csv
  File "/export/home/seguraem/python/csv.py", line 9, in <module>
    cs = csv.reader(fd)
AttributeError: 'module' object has no attribute 'reader'
=====================================================================================

Grazie

Emmanuel!

--
esta es mi vida e me la vivo hasta que dios quiera


_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a