Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #16719
| Date | 2011-12-06 09:49 -0200 |
|---|---|
| From | "Pedro Henrique G. Souto" <pedro.h.souto@gmail.com> |
| Subject | Re: whitespace cleanup |
| References | <4EDDFC48.2000903@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3341.1323172211.27778.python-list@python.org> (permalink) |
On 06/12/2011 09:28, Andrea Crotti wrote: > Now on Emacs I have a hook before every save that cleans up all the > "wrong" white spaces, > with the 'whitespace-cleanup' function. > > I would like that also for my non emacsers colleagues, and possibly with > a Python script. > I looked up around but I can't find anything useful, any advice? You can use the strip() method: [http://docs.python.org/release/2.3/lib/module-string.html] While reading the file as strings, the strip() method rips out all of the extra whitespace. > Thanks, > Andrea > Good luck! -- Att; Pedro Henrique G. Souto <pedro.h.souto@gmail.com>
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: whitespace cleanup "Pedro Henrique G. Souto" <pedro.h.souto@gmail.com> - 2011-12-06 09:49 -0200
csiph-web