Hola:

¿Tratar carácter a carácter? Recorre un ficherillo de unas cuantas
megas, primero así y luego con array, y mide lo que tarda. Puede ser
entre 500 y 2000 veces más lento que con el array...

Es cierto que es una solución sencilla, pero es leeeeenta...

Salduos



El Tue, 27 Nov 2007 12:05:00 +0100
Miguel Ángel García <[EMAIL PROTECTED]> escribió:

> ¿Y por qué no así?:
> 
> fd = open ("ficherito", "rb")
> 
> for line in fd:
>       for character in line:
>               tratar ( hex ( ord ( character ) ) )
> 
> fd.close()
> 
> A mí me parece más fácil que lo que habéis dicho... A lo mejor no te
> vale, pero creo que es la manera más sencilla :-D
> 
> 
> 
> El Thu, 22 Nov 2007 11:08:53 +0100
> Jose Luis Segura Lucas <[EMAIL PROTECTED]> escribió:
> 
> > Mucho más limpio y fácil, ¡muchas gracias!
> > 
> > El Thu, 22 Nov 2007 10:08:36 +0100
> > David Vallejo Fernández <[EMAIL PROTECTED]> escribió:
> > 
> > > Hola,
> > > 
> > > Creo que lo que buscas es lo siguiente:
> > > 
> > > # Read.
> > > newWork = array.array('B', open(work).read()).tolist()
> > > 
> > > # Write.
> > > array.array('B', model).tofile(open(path, 'w'))
> > > 
> > > Habla por sí solo.
> > > 
> > > Un saludo,
> > > David.
> > > 
> > _______________________________________________
> > CRySoL mailing list
> > http://crysol.inf-cr.uclm.es/
> > https://arco.inf-cr.uclm.es/cgi-bin/mailman/listinfo/crysol
> 
> 


-- 
¿Usuario de Linux? ¿Qué eres? ¿un driver?

Attachment: signature.asc
Description: PGP signature

_______________________________________________
CRySoL mailing list
http://crysol.inf-cr.uclm.es/
https://arco.inf-cr.uclm.es/cgi-bin/mailman/listinfo/crysol

Responder a