I want to create a list of all files in a directory using pathlib's glob. The file names may have an extension (ex.: 'text.txt', 'abc.csv') or not ('text', 'abc'). I do realize that this can be handled by the same solution which is the answer to 'How to glob two patterns with pathlib?' but at the moment I cannot believe that something so simple has no simple solution (though it is difficult to understand why glob doesn't allow a list of patterns).
Edit:
- The file names are just examples; so filtering for them is not my goal.
- There is a solution using two calls of glob and adding the results. The question is more specific: is there a simpler solution.
- using the pattern '**/*' is including all subdirectories, which is not intended
- using os.listdir only shifts the problem: now you have to filter out the directories.