def replacestrs(filename):
	"replace a certain type of string occurances in all files in a directory" 
	
	files = glob.glob(filename)
	#print 'files in files:', files
	stext = '-d0'
	rtext = '-r0'
	
	for line in fileinput.input(files,inplace=1):
		
		lineno = 0
  		lineno = string.find(line, stext)
  		if lineno >0:
  			line =line.replace(stext, rtext)
			
  		sys.stdout.write(line)
replace a certain type of string occurances in all files in a directory
recipes/Python/435904_sedawk__Pythscript_rename_subdirectories/recipe-435904.py