[PIPython] Re: Modificare out-put del comando ls

Andrea paz4x
Mar 8 Mar 2005 18:01:50 CET


Il giorno ven, 04-03-2005 alle 15:47 +0100, Carlo C8E Miron ha scritto:
> >>> import os
> >>> print os.path.splitext.__doc__
> Split the extension from a pathname.  Extension is everything from the
>     last dot to the end.  Returns "(root, ext)", either part may be empty.
> >>> [os.path.splitext(f)[0] for f in os.listdir("/home/miron/gamez")]
> ['wc90', 'aerofgt', 'ikarijp', 'capbowl2', 'wtennis', 'checkmat', ....

proprio quello che cercavo. 
Grazie.

grazie anche ad Andrea ;)




More information about the Python mailing list