FTP : get dir name with space caracters embedded + is ther something quicker than LIST

Carsten Gaebler news at snakefarm.org
Thu Apr 3 08:30:09 EST 2003


Andrew Markebo wrote:

> | .....
> | may 22   2001     name of directory
> | mar 15    02:00   other directory name
> | .....
> 
> Implementation error ;-) Maybe should try line.split(" ", 3), telling
> it only to split the 3 first spaces, the rest should probably stick
> together..

Since the columns seem to be separated by more than one space he would 
have to say

line.split(None, 3)

to actually split off the directory name. 'None' tells split() to treat 
any amount of whitespace as one single separator and to ignore leading 
and trailing whitespace.

cg.





More information about the Python-list mailing list