def detect_text(path):
 vision_client = vision.Client()
 with io.open(path, 'rb') as image_file:
  content = image_file.read()
 image = vision_client.image(content=content)
 texts = image.detect_text()
 print 'Texts:'
 for text in texts:
  print text.description

def detect_text ( path ) : vision_client = vision . Client ( ) with io . open ( path , 'rb' ) as image_file : content = image_file . read ( ) image = vision_client . image ( content = content ) texts = image . detect_text ( ) print 'Texts:' for text in texts : print text . description
detects text in the file .