Lining Up and PaddingTwo Similar Lists
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Fri Aug 29 16:40:08 EDT 2008
On Fri, 29 Aug 2008 09:40:32 -0700, W. eWatson wrote:
> Actually, I'm getting the file names from listdir, and they appear to be
> sorted low to high. I tried it on a folder with lots of dissimilar
> files.
But that's not guaranteed. It depends on the operating system and file
system driver if the names are sorted or not.
In [14]: os.listdir?
Type: builtin_function_or_method
Base Class: <type 'builtin_function_or_method'>
String Form: <built-in function listdir>
Namespace: Interactive
Docstring:
listdir(path) -> list_of_strings
Return a list containing the names of the entries in the directory.
path: path of directory to list
The list is in arbitrary order. It does not include the special
entries '.' and '..' even if they are present in the directory.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list