Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Strange behavior Date: Thu, 14 Jan 2016 23:56:46 +1100 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de /2JU7n6FKFaNf9YuMHBY4gcCzyE7yuWo2XHiUVoF9PTQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'expressions': 0.07; 'cc:addr:python-list': 0.09; 'output?': 0.09; 'script,': 0.09; 'python': 0.10; 'jan': 0.11; 'ignore': 0.14; 'file,': 0.15; 'interpreter': 0.15; 'thu,': 0.15; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'method;': 0.16; 'obviously,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'say.': 0.16; 'written.': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'saying': 0.22; 'correctly.': 0.22; 'help.': 0.23; 'header:In-Reply-To:1': 0.24; "i've": 0.25; "doesn't": 0.26; 'installed': 0.26; 'helpful': 0.27; 'message-id:@mail.gmail.com': 0.27; '14,': 0.27; 'values': 0.28; 'prints': 0.29; 'code': 0.30; 'returned': 0.32; 'getting': 0.33; 'file': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'quite': 0.35; 'but': 0.36; 'should': 0.36; 'created': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'stuff': 0.38; 'thank': 0.38; 'your': 0.60; 'behavior': 0.61; 'strange': 0.63; 'else.': 0.66; "they're": 0.66; 'results': 0.66; 'url:gl': 0.69; 'url:goo': 0.72; '3.5.1': 0.84; 'chrisa': 0.84; 'snapshot': 0.84; 'to:none': 0.91 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; bh=0V+iVQEGtS8uV2B3kbvoD/u/X0waC61eMECC4LpXeJU=; b=E5JPsXm8IPyTsZHCd2V4GGD8JHGdy6AoV9YzkL94GLFQV9IIcPmWb7W3wVEpj+85vJ sOgZu8XyjhT3kk2wCG2lLifJ33yt2Vcde3pWqIjQE4aSWLihHhpIz8fTXxSgXWjaBTEO XAySh6b7J3QegMvBKbWJmJ8Ndd1tCPqvACxZVrk5f4U1h8kTsjzm4IIWkOhSKIxBT0NM /MmTxyTjSEKHZZj8cqSqRj7tw0pp1u8Ucj3KNwa0kY9K4ILucxZrrc9Fh2vgZS64CZaq cD09PXyrKlAW8GT8xfzWFpbC7sfJlgorX+6HBV8qi1/assFyeVC26aZ+Ez5hjQC+ZPZ4 6vNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=0V+iVQEGtS8uV2B3kbvoD/u/X0waC61eMECC4LpXeJU=; b=nBkz0A+qDoWp+F7mpF4TVd5fdEoL3Gqrgqblroa3zedrBRDoSkQXrFbcyptpZvVw7J gs2fZtL9dNiuFL3/ThgKSsDYGZyzye/HEb7JStu5pOrVfBdrQeUlhGoj4ZJNgk9Zu+GM l6BoU35Lu/gxWCAhOisJe68WKHi9gpARo0JNcAs4vCfF80ph06k0oyL+7tFWGmBAs2LO DMMc+Pe6F0pKBASUC8B/DNKD1MbIrDe57/C33djZwCNEcHt/Gq7tx4M1sScioPoXX1oS A+iIapovKvHot4ZWOMQY8maKyANyvh3QYMPvBX+YPRU55U/ndJeeXBgPVvLfRY3rx5sm SBqw== X-Gm-Message-State: ALoCoQl93v6yJfu9KTzI2qB4mWRY5w3lwR2QY3USsj9cdVAbdClWHDcG+eRtmuxOmKALVQgUwZtibVqMW8ZYAxK1R5e3ODtvOA== X-Received: by 10.50.28.19 with SMTP id x19mr30168569igg.92.1452776206631; Thu, 14 Jan 2016 04:56:46 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101691 On Thu, Jan 14, 2016 at 3:03 PM, Michal Nalevanko wrote: > I've just installed Python 3.5.1 on my computer and came across somewhat > strange behavior. > > This is a snapshot of a short code that I wrote: https://goo.gl/izYbD0 > > Quite simple, you might say. Obviously, the program should create a new > text file, nothing else. But do you see the numbers it had added to the > output? > > Is this behavior normal or am I overlooking something? Thank you very much > for your help. Hi Michal! When you work with Python interactively, the interpreter prints out the results of expressions automatically. This doesn't happen when you write a script, but it's often helpful with simple tinkering. The numbers getting printed out are the returned values from the .write() method; they're a simple check saying how much stuff got written. You can ignore them - your file has been created correctly. ChrisA