0

I am looking for a command line tool which is written in Python (or shell script) and searches for uses of os / glob that can be replaced by pathlib.

One of many examples is:

# Old style
import os
os.path.dirname(__file__) + "/foo.txt"

# New style
from pathlib import Path
Path(__file__).parent / Path("foo.txt")

Is there a package which can do those types of replacements automatically or at least detect them?

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.