Python Document Text Detection OCR with spaces

I have the code off of google cloud and I am having trouble editing this to get the spaces out of images with the text.

def detect_document(path):
            """Detects document features in an image."""
            client = vision.ImageAnnotatorClient()

            with io.open(path, 'rb') as image_file:
                content = image_file.read()

            image = types.Image(content=content)

            response = client.document_text_detection(image=image)
            document = response.full_text_annotation

            for page in document.pages:
                for block in page.blocks:
                    block_words = []
                    for paragraph in block.paragraphs:
                        block_words.extend(paragraph.words)

                    block_symbols = []
                    for word in block_words:
                        block_symbols.extend(word.symbols)

                    block_text = ''
                    for symbol in block_symbols:
                        block_text = block_text + symbol.text

                    print('Block Content: {}'.format(block_text))

https://cloud.google.com/vision/docs/detecting-fulltext#vision-document-text-detection-python