I have inherited some Python scripts and I'm working to understand them. I am a beginner-level Python programmer but very experienced in several other scripting languages.
The following Python code snippet generates a file list which is then used in a later code block. I would like to understand exactly how it is doing it. I understand that os.path.isfile is a test for filetype and os.path.join combines the arguments in to a filepath string. Could someone help me understand the rest?
flist = [file for file in whls if os.path.isfile(os.path.join(whdir, i, file))]
things_we_want = [thing for thing in list_of_things if we_want(thing)]