python error:IsADirectoryError: [Errno 21] Is a directory
I am trying to decompress a list of .xz file and save them in a single folder,my code is show below
import shutil
path = "/content/drive/MyDriv开发者_开发技巧e/dataset_demo/Posts/"
output_path = "/content/sample_data/output/"
os.chdir(path)
for file_com in os.listdir(path):
if file_com.endswith('.xz'):
with lzma.open(file_com,'rb') as input:
with open(output_path,'wb') as output:
shutil.copyfileobj(input, output)
it noticed me that:"IsADirectoryError: [Errno 21] Is a directory: '/content/sample_data/output/'" and I know the final aim should be a file but how could I save them in a folder
What should I do next, and thanks for your help and time.
精彩评论