You may want to do something like this:
file = open("filename.txt","r") # Opens the file
sentence = file.readline().split() # ['A','s',' ','a',' ','m'...]
startQuote = sentence.index('"') # Finds first occurence
endQuote = sentence[startQuote::].index("'") # Finds first occurrence after first quote
stringSentence = ''.join(sentence[startQuote:endQuote:]) # Creates string with splicing
If you want the code to accommodate for 'smart quotes', you can simplify it to to:
file = open("filename.txt","r") # Opens the file
sentence = file.readline().split() # ['A','s',' ','a',' ','m'...]
startQuote = sentence.index(“) # Finds first occurence
endQuote = sentence.index(”) # Finds first occurrence of end quote
stringSentence = ''.join(sentence[startQuote:endQuote:]) # Creates string with splicing
You may have to fix up some 'fence-post-errors' in this code as I have not tested it.
I hope this gives you an idea of what you need to do.