You can use os.listdir
coupled with os.path.isdir
for this.
Enumerate all items in the directory you want and iterate through them while printing out the ones that are directories.
import oscurrent_directory = os.path.dirname(os.path.realpath(__file__))for dir in os.listdir(current_directory): if os.path.isdir(os.path.join(current_directory, dir)): print(dir)