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

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -