Skip to content

Tag: pathlib

python Path from pathlib module doesn’t add path separator

I have the following issue using Path from the pathlib library: I have tried with Path itself and manually giving it a path that I know exists: I was wondering why Path doesn’t simply add the backslash at the beginning? Is there a better way to build my path with the needed path separator from a list? I…

How to replace characters and rename multiple files?

I have a bunch of pdf files which has the file name as follows: AuthorA_2014_ This is a good article BIsanotherAuthor_1994_ Gr8 artcle CIsFatherOfB_1994_Minor article but not bad And so on. I would like to change the name of the files to this format: AuthorA2014This is a good article BIsanotherAuthor1994Gr8 a…