Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!usenet.ukfsn.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'skip:% 20': 0.09; 'subject:question': 0.10; 'python': 0.11; 'wrote': 0.14; 'code?': 0.16; 'splitting': 0.16; 'terribly': 0.16; 'rules': 0.22; 'question': 0.24; 'code:': 0.26; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'lines': 0.31; 'breaking': 0.31; 'screen': 0.34; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'hi,': 0.36; 'to:addr:python-list': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'eyes': 0.78; 'ok?': 0.84 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=rojKzVwM8+rM+y2B6Q43XSufaR2H1N7cUeb+yFGiXek=; b=v3DeAKbv6rR4HnhRbfKxOY9wPiP00+ki1eShA6JPdVu5Ug1iaSs1q8Sn5WtJueABMj iAU0+ql7eXE8n99gHUsKkjn8EQoTLlMp9/UlC981bLU9oXAaKrxoIIGzwske2hAgjE6n 4LreXkik/atdpb4Nu+qH6rutgTl7Bz7hfUIRAERtRUlvflSfmy6yjgyQPz3xPqsPqirc 3Ww/d9l6Or0rDjBvK4L4GMvz48A749bxLHVs2dwoMIFyfemSVCNxSojhsgwBZGxqEbtd DiWMFUI9Yi9YBcxV+Tc3KRLnpbYhd1KQw9v0inlbJ0IxCU+dn7o0jMGZ/jMa8LU7Xv3n 4rwg== MIME-Version: 1.0 X-Received: by 10.194.11.72 with SMTP id o8mr10698265wjb.0.1371849448580; Fri, 21 Jun 2013 14:17:28 -0700 (PDT) Date: Fri, 21 Jun 2013 17:17:28 -0400 Subject: n00b question on spacing From: "Yves S. Garret" To: python-list@python.org Content-Type: multipart/alternative; boundary=e89a8f234d49116a1704dfb09782 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371849457 news.xs4all.nl 15947 [2001:888:2000:d::a6]:33698 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48883 --e89a8f234d49116a1704dfb09782 Content-Type: text/plain; charset=ISO-8859-1 Hi, I have a question about breaking up really long lines of code in Python. I have the following line of code: log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider) Given the fact that it goes off very far to the right on my screen is not terribly pleasing to my eyes (and can be rude for other developers). I was thinking of splitting it up like so: log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider) Is this ok? Are there any rules in Python when it comes to breaking up long lines of code? --e89a8f234d49116a1704dfb09782 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, I have a question about breaking up rea= lly long lines of code in Python.

I have the following line of code:=
log.msg("Item wrote to MongoDB database %s/%s" %(settings[= 9;MONGODB_DB'], settings['MONGODB_COLLECTION']), level=3Dlog.DE= BUG, spider=3Dspider)

Given the fact that it goes off very far to the right on my scree= n is not terribly
pleasing to my eyes (and can be rude for other develo= pers).

I was thinking of splitting it up like so:
log.msg(&= quot;Item wrote to MongoDB database %s/%s"
=A0 %(settings['MONGODB_DB'], settings['MONGODB_COLLECTION'= ]),
=A0 level=3Dlog.DEBUG, spider=3Dspider)

Is this ok?=A0 = Are there any rules in Python when it comes to breaking up long lines of code?
--e89a8f234d49116a1704dfb09782--