Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy File with Varied Name
#2
You can use
import shutil
shutil.copyfile(src, dst)
The arguments src and dst need to be path names given as strings to the source file and the destination file. According to the documentation, dst must be the complete traget file name.
Reply


Messages In This Thread
Copy File with Varied Name - by LonghornJ - May-06-2019, 02:46 PM
RE: Copy File with Varied Name - by Gribouillis - May-06-2019, 09:29 PM
RE: Copy File with Varied Name - by LonghornJ - May-07-2019, 05:43 PM
RE: Copy File with Varied Name - by michalmonday - May-08-2019, 10:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 306 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  Copy Paste excel files based on the first letters of the file name Viento 2 476 Feb-07-2024, 12:24 PM
Last Post: Viento
  is it possible to copy image from email and place into excel file? cubangt 3 1,296 Nov-30-2022, 05:11 PM
Last Post: snippsat
  Please help me [copy and paste file from src to dst] midomarc 2 1,046 Nov-24-2022, 10:13 PM
Last Post: midomarc
  Copy column from one existing excel file to another file mkujawsk 0 5,684 Apr-14-2021, 06:33 PM
Last Post: mkujawsk
  Failing to copy file from a network to a local drive tester_V 4 7,204 Jan-20-2021, 07:40 AM
Last Post: tester_V
  Copy mp3 file multiple times and rename Mar10 4 3,780 Sep-23-2020, 01:09 AM
Last Post: Mar10
  Python Cut/Copy paste file from folder to another folder rdDrp 4 5,115 Aug-19-2020, 12:40 PM
Last Post: rdDrp
  Cannot copy file to another location rcmanu95 1 1,747 Jul-19-2020, 05:16 AM
Last Post: deanhystad
  copy content of text file with three delimiter into excel sheet vinaykumar 0 2,377 Jul-12-2020, 01:27 PM
Last Post: vinaykumar

Forum Jump:

User Panel Messages

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