无法使代码正常工作,以下代码应替换 = 之后和之前的内容
用户=“/静默测试=de”;
#!/usr/bin/python
import re
import fileinput
langids = ["de","uk","us","dk"]
for lang in langids:
for line in fileinput.FileInput("C:\Users\HS\Desktop\sps_r2850\Test.txt",inplace=1):
if re.match(".*user = \"[a-zA-Z/_= ]*\";.*", line):
line = ("user = \"/silent test=_%s\";\n" % lang)
print line,