[pyar] Generar nombres de archivos diferentes en base a uno ya existente

Marian mavignau en gmail.com
Mie Oct 8 19:09:23 ART 2014


¿con un diccionario?
archivos_dic={}


nombre_archivo_original = nombre_archivo
if archivos_dic.has_key(nombre_archivo):
      sufijo = archivos_dic[nombre_archivo]
      archivos_dic[nombre_archivo]+=1
      nombre_archivo+=str(sufijo)
else:
      archivos_dic[nombre_archivo]=0



El 5 de octubre de 2014, 11:34, German Jimenez <germanjimenez84 en gmail.com>
escribió:

> Aclaro el nombre del archivo sería: "DirA-DirB-readme.txt"
>
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>



-- 
Marian
"The corollary to this is that *appearances matter*. Programmers, in
particular, often don't like to believe this. *Their love of substance over
form is almost a point of professional pride.* It's no accident that so
many programmers exhibit an antipathy for marketing and public relations
work, " Producing OSS <http://producingoss.com/en/producingoss.html>
i-Terra <http://www.i-terra.com.ar> - Mi sitio Python
<https://sites.google.com/site/mavignau/de-visual-basic-a-python-como-y-porque>
____________________________
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20141008/9f5c9e18/attachment.html>


More information about the pyar mailing list