Guest User

Untitled

a guest
Dec 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. var1='C:/my/store/path'
  2.  
  3. myimage_1010_im.png
  4. myimage_1010_im1.png
  5. myimage_1010_im3.png
  6. myimage_1020_im.png
  7. myimage_1020_im1.png
  8.  
  9. var1='C:/my/store/path/myimage_1010_im.png'
  10.  
  11. import os
  12. cwd = os.getcwd()
  13. my_file='1010'
  14. path = os.path.join(cwd, my_file)
  15.  
  16. import glob
  17.  
  18. var1='C:/my/store/path/*'
  19.  
  20. paths = glob.glob(var1)
  21.  
  22. my_file='1010'
  23. selected_path = filter(lambda x: my_file in x, paths)
Add Comment
Please, Sign In to add comment