Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'subject:Python': 0.06; 'cc:addr:python-list': 0.11; 'python': 0.11; 'books': 0.15; '1:13': 0.16; 'blocks': 0.16; 'brackets,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'indent': 0.16; 'syntax,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'examples': 0.20; 'seems': 0.21; 'select': 0.22; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'header:In-Reply-To:1': 0.27; 'important.': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'controlled': 0.31; 'fault': 0.31; 'time;': 0.31; 'this.': 0.32; 'probably': 0.32; 'up.': 0.33; 'level.': 0.33; 'totally': 0.33; 'editor': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'should': 0.36; 'depends': 0.38; 'pm,': 0.38; '(from': 0.39; 'extremely': 0.39; 'pdf': 0.39; 'manually': 0.60; 'simply': 0.61; "you're": 0.61; "you'll": 0.62; 'subject:there': 0.68; 'pdf.': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=Yz54kPG0boqr+DclXnTUJDj27r4knb+PJidcs38kpiI=; b=FSi8YfOqDRkT98DR/f29kfQgmiBGwUmxKZMPr0BaCT6BEcv9WwPG6c2GPPuVc6JWD8 qvc5LkfBq/NCJTDOge7gvJaxTOK0oZmuUKDpfIkENhes7K3Z46Hlw9EnW6qYdxUEG2JU +WzShASBUCYx5QB6DRDMigv3V5yFnRUy25QfB0m4sGlpSNzwUoNYP0nX2mZrUe5bt6ni fPd2Z6Otb3yGtQo7/di6X4ar/qB5tgeglsBL+e+S25eed/wg49jBE3+quA67FsKaSsvt iFzaiJVDsM6x2Viuq/zAtN1MU1qPtGwRgRXd6nzZuGUChfg5khatnvVUekjNOtMVImKw NLKQ== MIME-Version: 1.0 X-Received: by 10.42.205.147 with SMTP id fq19mr8456969icb.47.1413339526960; Tue, 14 Oct 2014 19:18:46 -0700 (PDT) In-Reply-To: <9a0c67be-de3a-4770-bf06-e158783bfff0@googlegroups.com> References: <9a0c67be-de3a-4770-bf06-e158783bfff0@googlegroups.com> Date: Wed, 15 Oct 2014 13:18:46 +1100 Subject: Re: Is there an easy way to control indents in Python From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413340023 news.xs4all.nl 2851 [2001:888:2000:d::a6]:53200 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:79127 On Wed, Oct 15, 2014 at 1:13 PM, ryguy7272 wrote: > I'm just learning Python. It seems like indents are EXTREMELY important.= I guess, since there are no brackets, everything is controlled by indents= . Well, I'm reading a couple books on Python now, and in almost all of the= examples they don't have proper indents, so when I copy/paste the code (fr= om the PDF to the IDE) the indents are totally screwed up. I'm thinking th= at there should be some control, or setting, for this. I hope. :) > That probably depends on the person who made the PDF. You may simply have to copy and paste one line at a time; if you're using an editor that understands Python syntax, it'll do some of your indenting for you, and you'll just have to manually mark the unindents. Alternatively, just paste it all in without indentation, then go through and select blocks of code and hit Tab; in many editors, that'll indent the selected code by one level. But ultimately, the fault is almost certainly with the PDF. ChrisA