Es exactamente lo que hice.!, gracias!!

Saludos,
Gonzalo

El 30 de noviembre de 2015, 14:44, Miguel González Álvarez <
migonzal...@gmail.com> escribió:

>
>
> 2015-11-30 19:11 GMT+01:00 Gonzalo V <gvm2...@gmail.com>:
>
>> Hola muchachos
>> Tengo el siguiente script que hice y tengo el siguiente problema EOL
>> while scanning literal. He buscado en google y dice que me faltan comillas,
>> ¡pero lleva comillas e igual da el error!, alguien puede ayudarme?
>>
>> import urllib.request
>>
>> f=open('IPSA5.txt')
>>
>> for line in f:
>>     print(line)
>>     #a=()
>>     url='
>> http://www.bolsadesantiago.com/mercado/Paginas/Resumen-de-Instrumento.aspx?RequestHistorico=1&Nemo='+line
>>     ruta="C:\Python34\BETAS\"
>>     r=urllib.request.urlretrieve(url, filename=ruta + line+"csv")
>>     print('*** '+line+' LISTO***')
>>
>>
>> la linuea con rojo me da el error.
>> de antemano gracias.
>>
>>
> El caracter \ se usa para escapar comillas
>
> >>> "\"Si,\" le dijo."'"Si," le dijo.'
>
> En este caso se puede resolver escapando las barras con otra barra anterior
>
>     ruta= r"C:\\Python34\\BETAS\\"
>
> Más info en
> http://docs.python.org.ar/tutorial/3/introduction.html#cadenas-de-caracteres
> ​
>
>
>> Saludos,
>> Gonzalo
>>
>> _______________________________________________
>> Python-es mailing list
>> Python-es@python.org
>> https://mail.python.org/mailman/listinfo/python-es
>> FAQ: http://python-es-faq.wikidot.com/
>>
>>
>
>
> --
> Miguel González
> migonzal...@gmail.com
> PGP ID: 0C63761BEEBD05D3
>
> _______________________________________________
> Python-es mailing list
> Python-es@python.org
> https://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
>
>
_______________________________________________
Python-es mailing list
Python-es@python.org
https://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a