How can I write the following code more concisely?
scores = []
for f in glob.glob(path):
score = read_score(f, Normalize = True)
scores.append(score)
I know this can be written in one or two lines without using append
, but I'm a Python newbie.
Oh, I got it while browsing a related question:
scores = [read_score(f, normalize=True) for f in glob.glob(path)]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With