Python is going to be hard

Chris Angelico rosuav at gmail.com
Thu Sep 4 04:25:48 CEST 2014


On Thu, Sep 4, 2014 at 12:10 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> On Thursday, September 4, 2014 7:26:56 AM UTC+5:30, Chris Angelico wrote:
>> On Thu, Sep 4, 2014 at 11:48 AM, Rustom Mody wrote:
>> >>>> NO PRINT
>
>
>> Why are you so dead against print?
>
> Because it heralds a typical noob code-smell
> [especially  when the OP admits that BASIC is his background]

And, of course, all those lovely Unix programs that produce output on
stdout, they're full of code smell too, right? I don't care what
someone's background is; console output is *not* code smell.

Anyway, all you're doing is relying on the magic of interactive mode
to call repr() and print() for you.

>> Yes, or the OP could work with actual saved .py files and the
>> reliability that comes from predictable execution environments... and
>> use print.
>
> Dunno what you are talking about
>
> The interpreter-REPL is less reliable than a script?

When you start a script, you have a consistent environment - an empty
one. When you write a series of commands in the interactive
interpreter, the environment for each one depends on all the preceding
commands. So when you have a problem, you might have to copy and paste
the entire interpreter session, rather than just the one command.

ChrisA



More information about the Python-list mailing list