-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodify.py
More file actions
26 lines (21 loc) · 763 Bytes
/
modify.py
File metadata and controls
26 lines (21 loc) · 763 Bytes
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
import shutil
import site
import os
def get_site_packages_path():
return site.getsitepackages()[0]
def copy_files(files_to_copy):
site_packages_path = get_site_packages_path()
for src, dest in files_to_copy:
full_dest_path = os.path.join(site_packages_path, dest)
shutil.copyfile(src, full_dest_path)
print(f"Copied {src} to {full_dest_path}")
def move_file(src, dest):
site_packages_path = get_site_packages_path()
full_dest_path = os.path.join(site_packages_path, dest)
shutil.move(src, full_dest_path)
print(f"Moved {src} to {full_dest_path}")
if __name__ == "__main__":
files_to_copy = [
("./util/vision_transformer.py", "timm/models/vision_transformer.py")
]
copy_files(files_to_copy)