About 50 results
Open links in new tab
  1. How do I move a file in Python? - Stack Overflow

    Jan 13, 2012 · for those of you familiar with gnu-coreutils' mv command, python's shutil.move has one edge case where shutil.move function differs. Go here for full write up. In a nutshell, Python's …

  2. Moving all files from one directory to another using Python

    Jan 24, 2017 · I want to move all text files from one folder to another folder using Python. I found this code:

  3. Python - Move and overwrite files and folders - Stack Overflow

    I wanted to move files and folder structures and overwrite existing files, but not delete anything which is in the destination folder structure. I solved it by using os.walk(), recursively calling my function and …

  4. Rename and move file with Python - Stack Overflow

    In Python you can use the move function in shutil library to achieve this. Let's say on Linux, you have a file in /home/user/Downloads folder named "test.txt" and you want to move it to …

  5. How to move a file in a directory to another in python

    Dec 12, 2022 · I have a File that needs to be moved by my python script with shutil but I don't know where the origin location is, how do I find the origin location?

  6. How to move file from folder A to folder B in python?

    Oct 17, 2021 · 4 You can try importing shutil and calling shutil.move (source,destination). The shutil module provides functions for moving files, as well as entire folders.

  7. Is there a way to move many files quickly in Python?

    Oct 9, 2010 · 3 Edit: In my own state of confusion (which JoshD helpfully remedied), I forgot that shutil.move accepts directories, so you can (and should) just use that to move your directory as a batch.

  8. Moving files with python (Windows) - Stack Overflow

    Apr 8, 2014 · Move can replace an existing file (use /y), rename can't. You can both use slash or backslash, backslash needs to be escaped by using 2 backslashes where you need 1 and 4 …

  9. Python Move Files Based On Name - Stack Overflow

    Mar 19, 2016 · move(filename, full_path) Now, changing srcfiles = os.listdir(srcpath) and destdirs = list(set([filename[0:5] for filename in srcfiles])) with the code below gets me the paths in one variable …

  10. Move files between two AWS S3 buckets using boto3

    May 11, 2015 · I have to move files between one bucket to another with Python Boto API. (I need it to "Cut" the file from the first Bucket and "Paste" it in the second one). What is the best way to do that? …