import os
arr = os.listdir()
print(arr)
>>> ['$RECYCLE.BIN', 'work.txt', '3ebooks.txt', 'documents']
In MS Windows it works like this:
1. Hold the "Shift" key, right-click the folder containing the files and select "Open Command Window Here."
2. Type "dir /b > filenames.txt" (without quotation marks) in the Command Window. Press "Enter."
3. Inside the folder there should now be a file filenames.txt containing names of all the files etc. inside this folder.
4. Copy and paste this file list into your Word document.
import os
arr = next(os.walk('.'))[2]
print(arr)
>>> ['5bs_Turismo1.pdf', '5bs_Turismo1.pptx', 'esperienza.txt']
var fs = require('fs');
var files = fs.readdirSync('/assets/photos/');
import shutil
from fpdf import FPDF
import os
from os import listdir
from os.path import isfile, join
import glob
import re
print("Paste in the directory path :")
s=input()
all_dir=glob.glob(s)
print(all_dir)