import pathlib

# path: pathlib.Path - directory to remove contents of
def removeContents(path):
  for i in path.glob('*'):
    if i.is_dir():
      # NOTE: can replace both lines with `removeDirectory(i)` from pathlib-recusive-rmdir scrap
      removeContents(i)
      i.rmdir()
    else:
      i.unlink()

@@ -68,21 +68,21 @@
  of%0Adef 
-remov
+delet
 eContent
@@ -166,30 +166,35 @@
 ace 
-both
+two
  lines 
+below 
 with %60
-remov
+delet
 eDir
@@ -226,21 +226,32 @@
 ecusive-
-rmdir
+delete-directory
  scrap%0A 
@@ -255,21 +255,21 @@
 p%0A      
-remov
+delet
 eContent

Update pathlib-recusive-delete-contents.py