Suppose you have a directory structure like this:
A/
B/
a.1
b.2
c.3
I’m wondering if there’s a way, knowing that B has no siblings AND NOT KNOWING B’s NAME, to do an os.listdir operation in one swoop (that is, without calling os.listdir twice), instead of in three commands like so:
root = "A"
secondLevel = os.listdir(root)[0]
listing = os.listdir(os.path.join(root,secondLevel))
or maybe even