suhail shaik wrote: > print fileName > file = fileName.split(".") ......^^^^ this is a list you're shadowing a builtin -- generally a bad practice > print file > textfile = file[0]+".txt" > print textfile > os.chdir(PNAME) > file(textfile,'wt') ......^^^^ and this is why HTH, Emile