-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrangefile.py
More file actions
35 lines (29 loc) · 1.11 KB
/
arrangefile.py
File metadata and controls
35 lines (29 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copy a single file
import shutil
while (True):
choice = int(input("\nEnter 1 for File copy,\n 2 for Folder Copy ,\n 3 for Moving file or folder"))
if (choice == 1):
source = input("Enter Source of the file")
destination = input("Enter Destination of the file")
ch = int(input("Do you want to rename your file?"))
if (ch == 1):
rename = input("New Name")
rename = destination + '\\' + rename
shutil.copy(source, destination, rename)
else:
shutil.copy(source, destination)
# Copy an entire folder
elif(choice == 2):
source = input("Enter Source of the folder")
destination = input("Enter Destination of the folder")
shutil.copytree("source", "destination")
# Move a folder
elif (choice == 3):
source = input("Enter Source of the folder")
destination = input("Enter Destination of the folder")
shutil.move("source", "destination")
else:
print("Wrong Choice")
choice = int(input("Do You want to Continue? 1 for Yes 0 for No"))
if(choice!=1)
break