Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #27627 > unrolled thread
| Started by | Kamil Kuduk <kamil.kuduk@gmail.com> |
|---|---|
| First post | 2012-08-22 13:06 +0200 |
| Last post | 2012-08-22 13:06 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: help me debug my "word capitalizer" script Kamil Kuduk <kamil.kuduk@gmail.com> - 2012-08-22 13:06 +0200
| From | Kamil Kuduk <kamil.kuduk@gmail.com> |
|---|---|
| Date | 2012-08-22 13:06 +0200 |
| Subject | Re: help me debug my "word capitalizer" script |
| Message-ID | <mailman.3645.1345633589.4697.python-list@python.org> |
On Wed, Aug 22, 2012 at 12:41 PM, Chris Angelico <rosuav@gmail.com> wrote:
> Why less? Why not just redirect input?
Yeah, my bad, I somehow used to do it, for grep too, and I know that
this is slower
> Though, this isn't really on topic for Python.
I would still go with regexp, something like:
with open('myfile.txt', 'rw) as file:
print "".join(re.sub(r'\w{3,}', lambda(match):
match.group(0).title(), line) for line in file)
Back to top | Article view | comp.lang.python
csiph-web