import subprocess
var1 = "  "
var2 = ".txt"

subprocess.call(["ls -la -f *.* > temp.txt"],shell=True)
myfiles = open("temp.txt")
lines = myfiles.read().splitlines()

for i in lines:
  if "script_change.py" in i:
    print("I will not change %s " % i)
  else:
    myfile = open(i)
    newname = i + var2
    newfile = open(newname.lower(), "w") #dokuwiki needs to have the name only in lower case
    for j in myfile:
      newtext = var1 + j
      newfile.write(newtext)