I am doing a python3 software that use google_speech and and os.system command.
Everything work fine but when a user enter a string with the ' character I have this error : Syntax error: Unterminated quoted string
This is my code :
def textToSpeak():
global fieldValues
msg = "Enter the text to speak\n\nDon't use" +str(" \' ")+str(" write it like this : je tinvite chez moi, not je t\'invite chez moi ")
title = "Enter the text to speak"
fieldNames = ["Text to speak"]
fieldValues = []
fieldValues = multenterbox(msg, title, fieldNames)
speak()
def speak():
global lang, fieldValues
textValue = "google_speech -l" +str(lang) +str(" \'\"")+str(fieldValues[0])+str("\"\'")
os.system(textValue)