Python for complete beginners: A friendly guide to coding, no experience required by Martin Jones

Python for complete beginners: A friendly guide to coding, no experience required by Martin Jones

Author:Martin Jones [Jones, Martin]
Language: eng
Format: epub
Tags: General Fiction
Published: 2015-06-25T07:00:00+00:00


text = open("great_expectations.txt").read()

Now we can put these two bits of information – the text, and the start/stop positions – together to extract the speech. For now, we'll just print the extracted bits of text to the screen so that we can see if the program works:

text = open("great_expectations.txt").read()

speech_locations = open("speech.txt")

for line in speech_locations:

split_line = line.split(',')

start = split_line[0]

stop = split_line[1]

speech = text[start:stop]1

print(speech)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.