Ver Mensaje Individual
  #8 (permalink)  
Antiguo 20/05/2009, 20:31
Avatar de razpeitia
razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años, 2 meses
Puntos: 1360
Respuesta: ¿Como aumentar longitud de String?

Otra forma de hacerlo seria con un try

Código python:
Ver original
  1. def listado(dir):
  2.     try:
  3.         for file in os.listdir(dir):
  4.             archivo = dir + os.path.sep + file
  5.             if os.path.isfile(archivo):
  6.                 f.write(archivo+"\n")
  7.             else:
  8.                 listado(archivo)
  9.     except TypeError:
  10.             f.write(archivo+"\n")