Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #27635

Re: help me debug my "word capitalizer" script

References <CAE7MaQbrdVbbFWDJ8GHuoybT2SNPfZyyMFU_beBc_zMKpBHPFg@mail.gmail.com> <CAEtwbM0PwcSb6v5MZ=Dr3s9TVFoXzCOywd=JfWFfBUcM-RFLcQ@mail.gmail.com> <CAPTjJmr7JqsDx6ypjVODTvy315fFYZacNgns60QXmM+zJ5p+Xw@mail.gmail.com> <CAEtwbM2MZ9D_dwv0EYXF8h5G=ucOjVm33Y3Z+E=aMY1fr17Nxw@mail.gmail.com> <CAE7MaQaecoDCK-=bHA1C-grF6RDcOzb0K0oV22zmktoz0eaQbg@mail.gmail.com>
Date 2012-08-22 10:29 -0400
Subject Re: help me debug my "word capitalizer" script
From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3649.1345645757.4697.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Aug 22, 2012 at 9:00 AM, Santosh Kumar <sntshkmr60@gmail.com> wrote:
> OK! The bug one fixed. Thanks to Andreas Perstinger.
>
> Let's move to Bug #2:
>  2. How do I escape the words that are already in uppercase? For example:
>
> The input file has this:
> NASA
>
> The script changes this to:
> Nasa
>
> Is it possible to make this script look at a word, see if its first
> character is capitalized, if capitalized then skip that word. If not
> do the processing? I don't wan to use regex? Do I need it?
> --
> http://mail.python.org/mailman/listinfo/python-list

Go into your python shell and type help(str) or lookup the
documentation on the python site about strings
http://docs.python.org/library/string.html

There are methods to tell if a word is all caps, or if the first
letter is capitalized

-- 
Joel Goldstick

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: help me debug my "word capitalizer" script Joel Goldstick <joel.goldstick@gmail.com> - 2012-08-22 10:29 -0400

csiph-web