You cannot use absolute path unless your terminal is in that directory.
Hence you can do as following:
def rename(directory):
os.chdir(directory) # Changing to the directory you specified.
for name in os.listdir(directory):
print(name)
os.rename(name,"0"+name)