On 26 October 2016 at 20:37, oscar6echo <[email protected]> wrote:
>
> 2/
>
> for e in os.listdir('.'):
>
> print(e)
>
Can you try something like this:
for e in os.listdir('.'):
os.path.isdir(e)
print(e)
listdir() itself is probably not making it slow, it's listdir and then
doing things with each file that's the issue. scandir returns results with
a bit more information, so it doesn't necessarily have to go back to the
operating system to check 'is this a directory'.
Thomas
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/CAOvn4qhjk%3DpaFcTD12N510K6uM5sF8CpZg1_H5rt1cbWwNpyrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.