79764031

Date: 2025-09-14 00:46:07
Score: 1
Natty:
Report link

Actually, this can be done using the glob library using glob.glob:

path = 'img-0*.png' 

def is_globable(path):
    return bool(glob.glob(path))


if os.path.isfile(path):
    pass
elif is_globable(path):
    pass
else:
    raise Exception(...)

Here are the docs:

https://docs.python.org/3/library/glob.html (first thing)

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
Posted by: Aadvik