Renaming of files in OS directory

blur959 blur959 at hotmail.com
Sun Aug 8 10:02:36 CEST 2010


Hi, all, I am writing a program that renames files inside OS
directories the user provides. I am at the early stage of writing it
and I encountered some problems.

Below is my code. There is an error i received when i run this code.
The error is, WindowsError: [Error 123] The filename, directory name,
or volume label syntax is incorrect.

Hope you guys could help.



import os, glob

def fileDirectory():
    #Asks the user for a file root directory
    fileroot = raw_input("Please input the file root directory \n\n")
    print fileroot

    #Returns a list with all the files inside the file root directory
    os.listdir(fileroot)

fileDirectory()



More information about the Python-list mailing list