import os docpath = os.path.join("Doc", "library") tkprefix = "tkinter" torename = ["scrolledtext.rst", "tix.rst", "turtle.rst"] for f in torename: oldpath = os.path.join(docpath, f) newpath = os.path.join(docpath, "%s.%s" % (tkprefix, f)) cmd = "svn mv --force %s %s" % (oldpath, newpath) print cmd os.system(cmd)