Код: Выделить всё
Z_WRx1_x.gslides,Z_WRx2_x.gslides,Z_WRx3_x.gslides). Я хочу сделать копии нескольких глав книги.
Я подключил Google Диск, но не могу заставить Colab скопировать файлы. Я пробовал Shutil.copyfile()Код: Выделить всё
import shutil
chapter = 3
topics = ['African','Hinduism']
for topic in topics:
for dow in range(1,4):
shutil.copyfile(f"{workDir}Z_WRx{dow}_x.gslides", f"{workDir}WR{chapter}{dow}_{topic}.gslides")
chapter += 1
Код: Выделить всё
/usr/lib/python3.10/shutil.py in copyfile(src, dst, follow_symlinks)
252 os.symlink(os.readlink(src), dst)
253 else:
--> 254 with open(src, 'rb') as fsrc:
255 try:
256 with open(dst, 'wb') as fdst:
OSError: [Errno 95] Operation not supported: '/content/drive/MyDrive/Classes/RE190 World Rel/Slides/Z_WRx1_x.gslides'
У меня тоже попробовал использовать функцию оболочки cp:
Код: Выделить всё
chapter = 3
topics = ['African','Hinduism']
for topic in topics:
for dow in range(1,4):
!cp "{workDir}Z_WRx{dow}_x.gslides" "{workDir}WR{chapter}{dow}_{topic}.gslides"
chapter += 1
Код: Выделить всё
cp: cannot stat '/content/drive/MyDrive/Classes/RE190\ World Rel/Slides/Z_WRx1_x.gslides': No such file or directory
cp: cannot stat '/content/drive/MyDrive/Classes/RE190\ World Rel/Slides/Z_WRx2_x.gslides': No such file or directory
cp: cannot stat '/content/drive/MyDrive/Classes/RE190\ World Rel/Slides/Z_WRx3_x.gslides': No such file or directory
cp: cannot stat '/content/drive/MyDrive/Classes/RE190\ World Rel/Slides/Z_WRx1_x.gslides': No such file or directory
cp: cannot stat '/content/drive/MyDrive/Classes/RE190\ World Rel/Slides/Z_WRx2_x.gslides': No such file or directory
cp: cannot stat '/content/drive/MyDrive/Classes/RE190\ World Rel/Slides/Z_WRx3_x.gslides': No such file or directory
Агент ИИ Colab говорит, что это должно работать.

Предложения о том, что я делаю неправильный? Или это просто не поддерживается Colab?
Подробнее здесь: https://stackoverflow.com/questions/788 ... rive-files