How can I move a file in Python?

I’m trying to move a file from one directory to another using Python, but I’m not sure how to do it. Can anyone provide me with some code examples or guidance on how to accomplish this?

Here’s what I have so far:

import os
os.rename('path/to/current/file', 'path/to/new/destination/for/file')

But I keep getting an error message. Can someone help me figure out what I’m doing wrong here, or suggest an alternate way to move a file in Python?

Thank you for any help you can provide!