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


Groups > comp.lang.python > #65588

Re: Python 2.7.6 help with white spaces?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <swdunning@cox.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.016
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; 'variables': 0.07; 'subject:help': 0.08; 'string': 0.09; 'cc:addr :python-list': 0.11; 'assume': 0.14; 'integer.': 0.16; 'roy': 0.16; 'seconds.': 0.16; 'specifier': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'variable': 0.18; 'received:10.0.1': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'format,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'needed.': 0.30; 'url:mailman': 0.30; 'url:python': 0.33; 'trouble': 0.34; 'subject:with': 0.35; 'minutes,': 0.36; 'url:listinfo': 0.36; 'subject:?': 0.36; 'received:10.0': 0.36; 'url:org': 0.36; 'seconds': 0.37; 'two': 0.37; 'received:10': 0.37; 'pm,': 0.38; 'sure': 0.39; 'url:mail': 0.40; 'how': 0.40; 'remove': 0.60; 'header:Message-Id:1': 0.63; 'charset:windows-1252': 0.65; 'minutes': 0.67; 'smith': 0.68; 'article': 0.77; '2014,': 0.84; 'scott': 0.93
X-CT-Class Clean
X-CT-Score 0.00
X-CT-RefID str=0001.0A020206.52F45D1A.001C,ss=1,re=0.000,fgs=0
X-CT-Spam 0
X-Authority-Analysis v=2.0 cv=GKHW5JxK c=1 sm=1 a=MB85R812cvcrhCHz/P2OVA==:17 a=EcIEWpwOQlAA:10 a=G8Uczd0VNMoA:10 a=N659UExz7-8A:10 a=kviXuzpPAAAA:8 a=ONB2eeuiHFIA:10 a=VUfPOBp7AAAA:8 a=8AHkEIZyAAAA:8 a=k-F3Q6aMyXb2vqPEAtAA:9 a=pILNOxqGKmIA:10 a=5hK03km2n30A:10 a=VhVvL8HfBcoA:10 a=4vB-4DCPJfMA:10 a=MB85R812cvcrhCHz/P2OVA==:117
X-CM-Score 0.00
Authentication-Results cox.net; auth=pass (PLAIN) smtp.auth=swdunning@cox.net
Content-Type text/plain; charset=windows-1252
Mime-Version 1.0 (Mac OS X Mail 7.1 \(1827\))
Subject Re: Python 2.7.6 help with white spaces?
From Scott W Dunning <swdunning@cox.net>
In-Reply-To <PDY91n0183bjUJS01DYAz7>
Date Thu, 6 Feb 2014 21:12:08 -0700
Content-Transfer-Encoding quoted-printable
References <mailman.6467.1391736132.18130.python-list@python.org> <PDY91n0183bjUJS01DYAz7>
To Roy Smith <roy@panix.com>
X-Mailer Apple Mail (2.1827)
Cc python-list@python.org
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6477.1391746338.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391746338 news.xs4all.nl 2853 [2001:888:2000:d::a6]:33771
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65588

Show key headers only | View raw


what exactly is the “%d:%02d”% saying?  



On Feb 6, 2014, at 6:25 PM, Roy Smith <roy@panix.com> wrote:

> In article <mailman.6467.1391736132.18130.python-list@python.org>,
> Scott W Dunning <swdunning@cox.net> wrote:
> 
>> I am having trouble figuring out how to remove spacesŠ.
>> 
>> Assume variables exist for minutes and seconds. Each variable is an integer. 
>> How would you create a string in the format,
>> 
>> 3:11
>> 
>> with no spaces. where 3 is minutes and 11 is seconds.
>> 
>> 
>> Obviously when IŠ
>> 
>> print minutes, ³:², seconds
>> 
>> I get 3 : 11
>> 
>> how can I get it to print with no spaces?   
>> 
>> 3:11
> 
> print "%d:%02d" % (minutes, seconds)
> 
> The "02" for the seconds specifier makes sure you get exactly two 
> digits, with a leading zero if needed.
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Thread

Python 2.7.6 help with white spaces? Scott W Dunning <swdunning@cox.net> - 2014-02-06 18:22 -0700
  Re: Python 2.7.6 help with white spaces? Roy Smith <roy@panix.com> - 2014-02-06 20:25 -0500
  Re: Python 2.7.6 help with white spaces? Scott W Dunning <swdunning@cox.net> - 2014-02-06 21:12 -0700
  Re: Python 2.7.6 help with white spaces? Roy Smith <roy@panix.com> - 2014-02-06 23:26 -0500

csiph-web