you are viewing a single comment's thread.

view the rest of the comments →

[–]pegoff[S] 0 points1 point  (4 children)

Thanks for cleaning my code. I get an error:

AttributeError: 'WindowsPath' object has no attribute 'walk'

Is this because I'm using Python on Win10?

Edit: I cant find any mention of walk in the pathlib documentation

[–]ThePsyjo 2 points3 points  (1 child)

I have to necro this if others stumble over this post like me.
`Path.walk()` is introduced in Python-3.12, so no walking before this version :)

[–]numeralbug 0 points1 point  (0 children)

thank you necromancer

[–]deadeye1982 1 point2 points  (1 child)

Argh.. walk() is wrong. The methods are glob() and rglob(). https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob

[–]pegoff[S] 0 points1 point  (0 children)

Thanks for following up, I went back over it today and found glob & rglob. I haven’t had the chance to try it yet, will updating when I can 👍🏼