I wanted to loop through some files and put the content of those files into a new list but when I run the code, the result shows "None'.
import os
import glob
folder = os.path.join("R:", os.sep, "Files")
list = []
def notes():
for file in glob.glob(folder):
if file.endswith('.docx'):
with open(file,'r+') as f:
content = f.read()
for text in content:
new_list = list.append(text)
return new_list
print(notes())