List Visible And Hidden Sub-Directories Non-Recursively In Python
Note that this just gives you the names. No extra paths come through.
This code:
Code
=
=
Will return:
Code
['.invisible-dir', 'dir-2', 'dir-1']
Give a tree of files like:
Code
example_dir
├── .invisible-dir
│ ├── file-10.txt
│ └── file-9.txt
├── .invisible-file-1.txt
├── .invisible-file-2.txt
├── dir-1
│ ├── file-3.txt
│ └── file-4.txt
├── dir-2
│ ├── dir-3
│ │ ├── file-7.txt
│ │ └── file-8.txt
│ ├── file-5.txt
│ └── file-6.txt
├── file-1.txt
└── file-2.txt