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


Groups > comp.lang.python > #101691 > unrolled thread

Re: Strange behavior

Started byChris Angelico <rosuav@gmail.com>
First post2016-01-14 23:56 +1100
Last post2016-01-14 23:56 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Strange behavior Chris Angelico <rosuav@gmail.com> - 2016-01-14 23:56 +1100

#101691 — Re: Strange behavior

FromChris Angelico <rosuav@gmail.com>
Date2016-01-14 23:56 +1100
SubjectRe: Strange behavior
Message-ID<mailman.150.1452776209.13488.python-list@python.org>
On Thu, Jan 14, 2016 at 3:03 PM, Michal Nalevanko
<michal.nalevanko@gmail.com> 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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web