How to break a sentence in python depending on fullstop '.'?
<p>I writing a script in python in which I have the following string:</p>

<pre><code>a = "write This is mango. write This is orange."
</code></pre>

<p>I want to break this string into sentences and then add each sentence as an item of a list so it becomes:</p>

<pre><code>list = ['write This is mango.', 'write This is orange.']
</code></pre>

<p>I have tried using TextBlob but it is not reading it correctly.(Reads the whole string as one sentence).</p>

<p>Is there a simple way of doing it?</p>

<p>You know about <code>string.split</code>? It can take a multicharacter split criterion:</p>

<pre><code>&gt;&gt;&gt; "wer. wef. rgo.".split(". ")
['wer', 'wef', 'rgo.']
</code></pre>

<p>But it's not very flexible about things like amount of white space. If you can't control how many spaces come after the full stop, I recommend regular expressions ("import re"). For that matter, you could just split on "." and clean up the white space at the front of each sentence and the empty list that you will get after the last ".".</p>

python list