Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #37434 > unrolled thread
| Started by | Peter Otten <__peter__@web.de> |
|---|---|
| First post | 2013-01-23 10:46 +0100 |
| Last post | 2013-01-23 10:46 +0100 |
| 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: Any algorithm to preserve whitespaces? Peter Otten <__peter__@web.de> - 2013-01-23 10:46 +0100
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2013-01-23 10:46 +0100 |
| Subject | Re: Any algorithm to preserve whitespaces? |
| Message-ID | <mailman.875.1358934417.2939.python-list@python.org> |
Santosh Kumar wrote:
> I am in a problem.
>
> words = line.split(' ')
>
> preserve whitespaces but the problem is it writes an additional line
> after every line.
Strip off the newline at the end of the line with:
line = line.rstrip("\n")
words = line.split(" ")
Back to top | Article view | comp.lang.python
csiph-web