Renaming of files in OS directory

blur959 blur959 at hotmail.com
Sun Aug 8 10:35:54 CEST 2010


On Aug 8, 4:15 pm, Chris Rebert <c... at rebertia.com> wrote:
> On Sun, Aug 8, 2010 at 1:02 AM, blur959 <blur... at hotmail.com> wrote:
> > 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.
>
> Well, what directory did you input? Apparently it wasn't a valid or extant one.
>
> Cheers,
> Chris
> --http://blog.rebertia.com


I input for e.g, "C:" it works, basically, if i input a hard code
string inside os.listdir it works, but if i stored the string that the
user keyed inside a variable and run os.listdir with the variable,
there is that error. But inputing hard code string inside os.listdir
isn't what I want when I am writing this program.



More information about the Python-list mailing list