Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'subject:question': 0.08; '__future__': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.17; 'jan': 0.18; '>>>': 0.18; 'import': 0.21; '3.2': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'older': 0.27; '2.6': 0.27; 'header:X-Complaints-To:1': 0.28; '>>>>': 0.29; 'function': 0.30; 'figure': 0.30; 'print': 0.32; 'function.': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'pm,': 0.35; 'add': 0.36; 'received:org': 0.36; 'but': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'space': 0.39; 'header:Received:5': 0.40; 'behavior': 0.64; 'discovered': 0.83; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: newbie ``print`` question Date: Sun, 02 Sep 2012 14:33:08 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346610805 news.xs4all.nl 6909 [2001:888:2000:d::a6]:43231 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28287 On 9/2/2012 1:23 PM, gwhite wrote: > I can't figure out how to stop the "add a space at the beginning" > behavior of the print function. > >>>> print 1,;print 2, > 1 2 You have discovered why print is a function in 3.x. >>> print(1, 2, sep='') 12 >>> print(1, end=''); print(2, end='') 12 In 2.6 or 2.7, you can add from __future__ import print_function but I recommend using 3.2 or 3.3 unless you have a reason to use older Python. -- Terry Jan Reedy