fork(1) download
  1.  
  2. file=r"""/IVTP/DB_db/0171-0_7-296&519_510&586-501&586_296&585_305&519_510&520-0_9_25_31_33_33_32-205-35.jpg
  3. /IVTP/DB_db/0069-0_2-450&447_581&491-579&491_450&490_452&447_581&448-0_0_9_29_17_24_30-209-15.jpg
  4. /IVTP/DB_base/0395-4_7-175&502_475&612-456&612_175&590_194&502_475&524-10_0_9_14_26_27_27-206-22.jpg
  5. /IVTP/DB_base/0234-7_21-271&499_461&602-461&602_291&580_271&499_441&521-0_0_1_32_31_31_18-215-37.jpg
  6. /IVTP/DB_cc/0291-0_7-271&483_527&578-517&574_271&578_281&487_527&483-0_0_20_29_33_26_18-212-93.jpg
  7. /IVTP/DB_cc/0325-1_6-227&475_507&572-499&565_227&572_235&482_507&475-0_0_23_28_33_25_33-212-30.jpg"""
  8.  
  9. imgs_data = ['0291-0_7-271&483_527&578-517&574_271&578_281&487_527&483-0_0_20_29_33_26_18-212-93.jpg',
  10. '0325-1_6-227&475_507&572-499&565_227&572_235&482_507&475-0_0_23_28_33_25_33-212-30.jpg'] # fake
  11. # [f for f in os.listdir('.') if f.endswith('.jpg')]
  12.  
  13. imgs_paths_to_str = []
  14.  
  15. for line in file.splitlines():
  16. line = line.strip()
  17. if line:
  18. imgs_paths_to_str.append(line)
  19.  
  20. new_list = []
  21. for img in imgs_data:
  22. for ipts in imgs_paths_to_str:
  23. if ipts.startswith('/IVTP/') and ipts.endswith(img):
  24. print(ipts) # new_list.append(ipts)
  25.  
Success #stdin #stdout 0.02s 9240KB
stdin
Standard input is empty
stdout
/IVTP/DB_cc/0291-0_7-271&483_527&578-517&574_271&578_281&487_527&483-0_0_20_29_33_26_18-212-93.jpg
/IVTP/DB_cc/0325-1_6-227&475_507&572-499&565_227&572_235&482_507&475-0_0_23_28_33_25_33-212-30.jpg