Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #49400
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <feather.duster.kung.fu@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.107 |
| X-Spam-Level | * |
| X-Spam-Evidence | '*H*': 0.79; '*S*': 0.01; 'else:': 0.03; '")': 0.09; '8bit%:78': 0.09; 'subject:extra': 0.09; 'subject:string': 0.09; 'def': 0.12; '#this': 0.16; 'subject:when': 0.16; 'subject:python': 0.16; 'print': 0.22; 'skip:l 30': 0.24; 'skip:\xa0 20': 0.24; 'compare': 0.26; 'skip:" 30': 0.26; 'skip:" 20': 0.27; 'tried': 0.27; '8bit%:3': 0.30; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; 'lines': 0.31; 'skip:& 30': 0.33; 'subject:from': 0.34; 'received:google.com': 0.35; 'skip:f 40': 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; '\xa0\xa0\xa0': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; '8bit%:47': 0.60; 'skip:n 30': 0.60; 'numbers': 0.61; 'first': 0.61; 'skip:n 10': 0.64; 'number:': 0.66; 'due': 0.66; 'between': 0.67; '8bit%:31': 0.68; '8bit%:100': 0.72; '"white': 0.84; '8bit%:49': 0.84; 'subject:space': 0.84; '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0': 0.84; '"white': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=islrwng5mvlGCy98RiDyY7xvf2zQMY/P+y6Jl6q0CaU=; b=FfsnFmKYnBLfkBDurjY+7xrbcQm+m5RJ2tgYmjd9JiWL+kcpa2SFItowWHAkAXoU8z Ue0i7Fxa84EytAc5uWg2c9sjNVYW/f0+rpmVOVJDJe8e4bmKBH1BOS2otQBfVnw4C1wy broqZERwtld8xBeikL45leO6GFozpDqjjdHuOPl6MYPxci9DYqgrzmFJwoYHAM4TE0b4 Ybq0wIxk1f7WOqrvKXUFkHN9im/58VSfZHWhpLaSNUPlbLIf1TBM1svi4h6bKNiNf8Lo 9EHxjM2VsHUe0rtYZiNU1Zchk0lefMZgHYFJcGpn8An3088D9JFAN+YUE55Z/OFeZTI2 7zCA== |
| MIME-Version | 1.0 |
| X-Received | by 10.221.9.68 with SMTP id ov4mr6528148vcb.6.1372471636216; Fri, 28 Jun 2013 19:07:16 -0700 (PDT) |
| Date | Fri, 28 Jun 2013 19:07:16 -0700 |
| Subject | python adds an extra half space when reading from a string or list |
| From | charles benoit <feather.duster.kung.fu@gmail.com> |
| To | python-list@python.org |
| Content-Type | multipart/alternative; boundary=089e011778f557511804e04174bd |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3978.1372472409.3114.python-list@python.org> (permalink) |
| Lines | 176 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1372472409 news.xs4all.nl 15927 [2001:888:2000:d::a6]:36496 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:49400 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
number_drawn=()
def load(lot_number,number_drawn):
first=input("enter first lot: ")
last=input("enter last lot: ")
for lot_number in range(first,last):
line_out=str(lot_number)
for count in range(1,5):
number_drawn=raw_input("number: ")
line_out=line_out+(number_drawn)
print line_out
finale_line.append(line_out)
finale_line2=finale_line
load(lot_number,number_drawn)
print finale_line
print(" "*4),
for n in range(1,41):
print n, #this is to produce a line of numbers to compare to
output#
for a in finale_line:
print"\n",
print a[0]," ",
space_count=1
for b in range(1,5):
if int(a[b])<10:
print(" "*(int(a[b])-space_count)),int(a[b]),
space_count=int(a[b])
else:
print(" "*(a[b]-space_count)),a[b],
space_count=a[b]+1
number_drawn=()
def load(lot_number,number_drawn):
first=input("enter first lot: ")
last=input("enter last lot: ")
for lot_number in range(first,last):
line_out=str(lot_number)
for count in range(1,5):
number_drawn=raw_input("number: ")
line_out=line_out+(number_drawn)
print line_out
finale_line.append(line_out)
finale_line2=finale_line
load(lot_number,number_drawn)
print finale_line
print(" "*4),
for n in range(1,41):
print n, #this is to produce a line of numbers to compare to
output#
for a in finale_line:
print"\n",
print a[0]," ",
space_count=1
for b in range(1,5):
if int(a[b])<10:
print(" "*(int(a[b])-space_count)),int(a[b]),
space_count=int(a[b])
else:
print(" "*(a[b]-space_count)),a[b],
space_count=a[b]+1
this generates
<type 'list'>
enter first lot: 1
enter last lot: 4
number: 2
number: 3
number: 4
number: 5
12345
number: 1
number: 2
number: 3
number: 4
21234
number: 3
number: 4
number: 5
number: 6
33456
['12345', '21234', '33456']
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
27 28 29 30 31 32 33 34 35 36 37 38 39 40
1 2 3 4 5
2 1 2 3 4
3 3 4 5 6
>#as you can see many numbers are between the lines of a normal print#
#I thought this was due to "white space" int he format .So I tried a list
of strings and got the same results.#
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
python adds an extra half space when reading from a string or list charles benoit <feather.duster.kung.fu@gmail.com> - 2013-06-28 19:07 -0700
csiph-web