how to create file with spaces

infidel saint.infidel at gmail.com
Thu Apr 6 14:53:50 EDT 2006


dirpath is just a string, so there's no sense in putting it in a list
and then iterating over that list.

If you're trying to do something with each file in the tree:

for dir, subdirs, names in os.walk(rootdir):
    for name in names:
        filepath = os.path.join(dir, name) + "-dummy"
        if not os.path.exists(filepath):
            f = open(filepath, 'w').write('')




More information about the Python-list mailing list