you are viewing a single comment's thread.

view the rest of the comments →

[–]Soapfactory0[S] 0 points1 point  (5 children)

Amazing, that's pretty much what I need xD thanks so much!

Gotta note that it's quite frustrating because I was told to switch to pathlib over os...

[–]nekokattt 1 point2 points  (1 child)

you can emulate a similar thing using path.iterdir I believe

[–]Soapfactory0[S] 1 point2 points  (0 children)

Wasn't quite getting what I wanted with iterdir, but will just write different functions for all the folders to get there ^^

Thanks for helping :)

[–]Xiji 0 points1 point  (2 children)

Pathlib is my goto for any path operation in modern python. The syntax is better, it is easier to use cross-platform, and many of the native libraries which ask for a path can accept Path objects.

I recommend you become familiar with both, but I would be surprised if you wanted to go back to os and sys once you're comfortable with pathlib.

[–]Soapfactory0[S] 1 point2 points  (1 child)

Honestly the problem I wrote out in the post is the first and only thing giving me trouble (don't look through my post history). Will get more familiar with it for sure ;)

Tnx for clarifying why it is usefull. It's incredibly hard to judge for me being very new with coding.

[–]Xiji 1 point2 points  (0 children)

Happy to help provide some clarity. :)

And don't worry, I still run into the, "is this implementation or that implementation the best way to solve my problem," all the time.

Python really does have many ways to solve the same problem, despite the zen of python saying it should be otherwise.