from os import listdir
from os.path import isfile, join

path = r"F:\Users\R. Wacanno\Pictures\assets\proj\wf-foto's website\sph"
fw = open('sph.txt', 'w')

onlyfiles = [f for f in listdir(path) if isfile(join(path, f))]

fw.write('[')

for f in onlyfiles:
    fw.write(f"'{f[:-4]}', ")

fw.write(']')