title: python glob file exist or not
body: <pre><code>testIDs=subprocess.Popen('ls cskpiSummary-310410-LTE-K-M2M-L-*UE1* | cut -d"-" -f7 | uniq', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  try:
          os.chdir(QMDLPath)
  except OSError:
          print 'QMDL Directory not found'
          exit()
  
  for testID in testIDs.stdout:
          for file in glob.glob("*"+testID+"*"):
                  print file
  </code></pre>
  
  <p>Would someone be able to point out what am I doing wrong here? The testIDs = subprocess extracts a list of testIDs(e.g: 20150422111035146). I want to use that as a pattern to see if file exists or not under QMDLPath directory which I have changed through chdir. If it is "NOT" present, print that test ID otherwise print a message that no files are missing.The sample file name will be diag-20150422111035146-server1.txt</p>