What's the equivalent of this bash command in Python?
chmod -R u+x $dir_path
There is os.fchmod but not sure if it applies recursively as the original command does.
Does this do the same thing that I want?
import os
import stat
from pathlib import Path
fd = Path(dir_path).open().fileno()
os.fchmod(fd, stat.S_IXUSR)