Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - Glob without absolute path

Tags:

I m using glob in order to get names of pairs of pictures for a great number of images. The only problem is that i get absolute path and i dont want of that, i need only names of pictures. How can i do?

import glob

A=sorted(glob.glob('/media/test/A*.png'))
B=sorted(glob.glob('/media/test/B*.png'))
NumbSeq=len(A)
for i in range(0,NumbSeq):
  print "\"%s\",\"%s\","%(A[i],B[i])

I get that :

 "/media/test/A170900_85495.460376.png","/media/test/B170900_85495.460376.png"

I need that :

 "A170900_85495.460376.png","B170900_85495.460376.png"