pythonos.walknon-recursive

Non-recursive os.walk()


I'm looking for a way to do a non-recursive os.walk() walk, just like os.listdir() works. But I need to return in the same way the os.walk() returns. Any idea?

Thank you in advance.


Solution

  • next(os.walk(...))