如何在给定目录及其子目录中递归替换给定替换的匹配?
import os
import re
from os.path import walk
for root, dirs, files in os.walk("/home/noa/Desktop/codes"):
for name in dirs:
re.search("dbname=noa user=noa", "dbname=masi user=masi")
// I am trying to replace here a given match in a file
Run Code Online (Sandbox Code Playgroud)