Python Forum
copying an Excelsheet with its conent and renaming into different names
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
copying an Excelsheet with its conent and renaming into different names
#4
Well, you can use a loop to make several copies
import shutil
from pathlib import Path

def multicopy2(src, idst):
    for dst in idst:
        shutil.copy2(src, dst)

p = Path("C:")/"copy excel"
multicopy2(p/"a.xlsm", [p/"b.xlsm", p/"c.xlsm", p/"d.xlsm"])
Reply


Messages In This Thread
RE: copying an Excelsheet with its conent and renaming into different names - by Gribouillis - Jun-04-2020, 08:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Information automatic document renaming lisa_d 2 439 Mar-20-2024, 06:34 PM
Last Post: Pedroski55
  renaming the 0 column in a dataframe Led_Zeppelin 5 1,776 Aug-16-2022, 04:07 PM
Last Post: deanhystad
  Functions to consider for file renaming and moving around directories cubangt 2 1,872 Jan-07-2022, 02:16 PM
Last Post: cubangt
  Python with win32com and EXIF renaming files. Amrcodes 4 3,845 Apr-03-2021, 08:51 PM
Last Post: DeaD_EyE
  Copying a file Kundan 1 2,217 Aug-21-2019, 09:55 AM
Last Post: snippsat
  renaming the file in a suitable format, I just wondering if it is possible go127a 11 5,373 Jun-26-2019, 06:15 AM
Last Post: snippsat
  Renaming explorer files in order? stroudie2 2 3,015 Mar-03-2019, 12:41 AM
Last Post: stroudie2
  script for renaming batch of files rado_789 5 3,464 Nov-07-2018, 02:18 PM
Last Post: rado_789
  Need help with file renaming edlentz 3 2,635 Aug-06-2018, 04:28 PM
Last Post: ichabod801
  Renaming PDF files using Excel data - Python okanaira 4 7,115 Mar-20-2018, 07:31 PM
Last Post: okanaira

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020