# change based on old/new vlaues
import platform
# creates user system variables
varRoot_old = nuke.getInput('Old File Root', 'E:/')
varRoot_new = nuke.getInput('New File Root', 'E:/someotherfolder/')
# make sure that the file paths end in a backslash (/)
if varRoot_old[ len(varRoot_old) - 1 ] != '/':
varRoot_old += '/'
if varRoot_new[ len(varRoot_new) - 1 ] != '/':
varRoot_new += '/'
# create a list of all of only the Read nodes in the Nuke script
a = nuke.allNodes('Read')
i = 0
for n in a:
# set the working node from the list of nodes based on it's name
b = nuke.toNode(a[i].name())
# get the file path for the current node
c = b['file'].getValue()
# change from the old root path to the new root path
d = c.replace(varRoot_old, varRoot_new)
# replace the file path with the new file path
b['file'].setValue(d)
i += 1