P3D Functions/Methods For Python Ones

Is there a P3D function equivalent to Python’s listdir function?

Since I’m on windows, I’m using window’s pathing, but if I wanted an APP to cross platform, that wouldn’t work.

How can you use python methods like listdir so that it’s compatible with all P3D platforms?

I know there’s a P3D open for Python’s open, but is that the only one?

Yeah, Panda has a listdir function in the direct.stdpy.file module.

so it would be -

from direct.stdpy.file import listdir

:question:


Yep, it worked!

Would I use it like stdpy.file.listdir()? or just listdir()?

If you import it like that, you’d just use listdir().