[Baypiggies] Python course for non-programmer

Isaac hyperneato at gmail.com
Mon Mar 5 17:30:51 CET 2007


I think I found part of why it is different:

sentences = re.split(r'((?:\.|\?|!|\n\n)\s*)', msg)

is not splitting msg correctly because windows and unix have different
newline characters.(?)

try:

sentences = re.split(r'((?:\.|\?|!|\n\n|\r\n)\s*)', msg)

references:
http://en.wikipedia.org/wiki/Newline#Newline_in_programming_languages
http://www.python.org/dev/peps/pep-0278/

-isaac

On 3/5/07, Bob Ippolito <bob at redivi.com> wrote:
>
> On 3/5/07, wesley chun <wescpy at gmail.com> wrote:
> > On 3/4/07, Isaac <hyperneato at gmail.com> wrote:
> > > This will capitalize the "I" and "I've" and keep the original capitals
> in
> > > the 'msg'.
> > > Thanks for the inspiration. I had a great time hacking!
> >
> >
> > is there a way to generalize "i'"?  you'd need to support "i'm",
> > "i'd", "i'll", etc.
> >
> > finally, is there a way to incorporate all your code into gmail so
> > that it does it automagically when i click "send"?  :-)
>
> Rewrite it in JavaScript and use Greasemonkey? The code would
> practically be the same since it's mostly just regex sludge.
>
> -bob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/baypiggies/attachments/20070305/566661a1/attachment.htm 


More information about the Baypiggies mailing list