[pyar] Duda con Path para leer archivo

Roberto Bozzacchi robbie en metasigno.com
Lun Feb 6 17:21:26 ART 2012


También probé lo siguiente:

>>>
>>> miFile = r'C:\Files\CON_SI\185-01.txt'
>>> miFile
'C:\\Files\\CON_SI\\185-01.txt'
>>> with open(miFile) as fh:
    for linea in fh:
        print(linea)

Traceback (most recent call last):
  File "<pyshell#102>", line 1, in <module>
    with open(miFile) as fh:
IOError: [Errno 2] No such file or directory:
'C:\\Files\\CON_SI\\185-01.txt'


Pero si hago esto si funciona:
>>> miFile = r'C:\Files\CON_SI\Prueba.txt'
>>> miFile
'C:\\Files\\CON_SI\\Prueba.txt'
>>> with open(miFile) as fh:
    for linea in fh:
        print(linea)


3,3,,,,,,,,,,,,,,,,,,,,,,142,Churruca
,117,,,,,,,,,,,,,,,

4,3,,,,,,,,,,,,,,,,,,,,142,Churruca
,142,,,,,,,,,,,,,,,,,

5,3,,,,,,,,,,,,,,,,,,142,Churruca
,,,142,,,,,,,,,,,,,,,,,



Lo cual la conclusión es que el problema es el nombre del archivo...

-- 

Robbie Bozzacchi
Metasigno Brain
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120206/3defa3f0/attachment.html>


More information about the pyar mailing list