Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cut and Paste
#3
(Jan-19-2021, 11:15 PM)spaceraiders Wrote: You can use the copytree method from the shutil module.

Usage is as such: shutil.copytree("src", "dst")

import shutil
shutil.copytree("src/folder/path/", "dst/folder/path")
In your case, the src path should be the path to the assets folder, and the dst path should be the path to your User's AppData folder.
"C:/Users/<Username>/AppData/my_script"

Be warned, however, the path the folder is going to be copied to must not exist. the last segment of the path will become the name of the folder, so in my case, whatever "src/folder/path" leads to, will be copied to "path/to", and the folder will be named "path."

how do i get the directorys, which changes from computer to computer!?
Reply


Messages In This Thread
Cut and Paste - by Oshadha - Jan-19-2021, 09:39 AM
RE: Cut and Paste - by spaceraiders - Jan-19-2021, 11:15 PM
RE: Cut and Paste - by Oshadha - Jan-20-2021, 06:47 AM
RE: Cut and Paste - by spaceraiders - Jan-20-2021, 04:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What script to paste folders thenewcoder 1 678 Nov-29-2023, 09:40 AM
Last Post: Pedroski55
  Please help me [copy and paste file from src to dst] midomarc 2 1,032 Nov-24-2022, 10:13 PM
Last Post: midomarc
  ImageTk Paste KDog 14 6,995 Jun-27-2021, 11:07 AM
Last Post: KDog
  copy paste file and re-name it asheru93 1 2,392 May-24-2019, 10:43 AM
Last Post: heiner55

Forum Jump:

User Panel Messages

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