So I've written a filename to variable
output = '/tmp/file'
output = os.path.abspath(output)
Then I moved the file
shutil.move(output, '/tmp/modified/')
How should I properly update the variable output modified by shutil.move?
shutil.move returns the destination:
output = shutil.move(output, '/tmp/modified/')
Edit on python2 shutil.move doesn't return. so if you have the destination you can just set output equal to it:
shutil.move(output, destination)
output = destination
If you need the absolute path you can use os.path.abspath(destination)