I want find two types of files with two different extensions: .jl
and .jsonlines
. I use
from pathlib import Path
p1 = Path("/path/to/dir").joinpath().glob("*.jl")
p2 = Path("/path/to/dir").joinpath().glob("*.jsonlines")
but I want p1
and p2
as one variable not two. Should I merge p1
and p2
in first place? Are there other ways to concatinate glob's patterns?
Inspired by @aditi's answer, I came up with this:
Try this: