Home > Software engineering >  Opening only file but not contents of zip folder
Opening only file but not contents of zip folder

Time:02-10

I'm trying to open a zipped file, with .txt corresponding to different books inside but it keeps saying the folder is empty, alongside all the other folders on my computer. Can anyone help?

from tkinter.filedialog import askdirectory

data_directory = askdirectory(initialdir = "/Users/nicol/Desktop/Code")

import glob
data_directory = askdirectory(initialdir = "/Users/nicol/Desktop/Code")
text_files = glob.glob(data_directory   "/"   "*.txt")

for f in text_files:
    infile = open(f,'r',encoding="UTF-8")

CodePudding user response:

  •  Tags:  
  • Related