import glob, os, shutil
dir=raw_input("Addres directory: ")
for i in glob.glob(dir+'*.*'):
if os.path.isdir(os.path.split(i)[0]+"/"+os.path.splitext(os.path.split(i)[-1])[0]+"/"):
shutil.move(i,os.path.split(i)[0]+"/"+os.path.splitext(os.path.split(i)[-1])[0]+"/"+os.path.split(i)[-1])
print "File "+i+" codied in "+os.path.split(i)[0]+"/"+os.path.splitext(os.path.split(i)[-1])[0]+"/"+os.path.split(i)[-1]