This will at least allow me to ID folders that start with whitespace... from within Windows too :) yet I still cannot rename the folders after stripping the whitespace... attempting to gives an [Errno 2] No such file or directory. The strip seems to work right too according to the prints before and after.
import os import os.path import string dirs = os.listdir(os.getcwd()) path = os.getcwd() ##print path for d in dirs: # If the first space in a folder name is whitespace. if d[0] in string.whitespace: ## print d try: new_path = os.path.join(path, d.strip()) old_path = os.path.join(path, d) print new_path print old_path os.renames(old_path, new_path) except Exception, e: print e else: pass -- http://mail.python.org/mailman/listinfo/python-list