Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこのようなforループを持っています:
for i in conversion: for f in glob.glob(i): print(os.path.getsize(f))
これをリスト内包表記に変換したい:
これを試しました:
[os.path.getsize(f) for f in glob.glob(i) for i in conversion]
しかし、動作しませんでした。
forダブルリスト内包におけるループの順序は、ネストされたループで使用するのと同じ順序です。
for
[os.path.getsize(f) for i in conversion for f in glob.glob(i)]
内側のループがより「内側」であると期待するため、少し混乱しますが、ネストされたループと同じ順序であることに気付くと、すべてが簡単になります:)
Can anyone tell me why I'm getting the "Run-time error '91'" message in my function below? It's happening on this line:
Set