python 3.x - How to check the part of file name in python3? -
for example
if have files:
applepie.txt applejam.txt applesauce.txt beercan.txt beercup.txt
and want download apple.txt, boar.txt, , cat.txt on internet.
here's point.
if not os.path.isfile(apple.txt) urlretrieve(apple.txt)
is not work, of course. there not apple.txt.
but exist applepie, jam, sauce.
so don't want download apple, boar, cat.
how can check of apple files, , pass download.
you can use os.listdir()
or glob
module. listdir
easier use should start that.
Comments
Post a Comment