file-manager

How to find files and skip directories in os.listdir

How to find files and skip directories in os.listdir Question: I use os.listdir and it works fine, but I get sub-directories in the list also, which is not what I want: I need only files. What function do I need to use for that? I looked also at os.walk and it seems to be what …

Total answers: 7