Python is going to be hard
rustompmody at gmail.com
Fri Sep 5 04:24:21 CEST 2014
On Thursday, September 4, 2014 7:38:40 PM UTC+5:30, Chris Angelico wrote:
> So a fairer comparison is: How many applications produce non-debug
> output on stderr or stdout? And that would be a much larger
> percentage. Even GUI programs will, in some cases - for instance, try
> firing up your favorite GUI text editor with no X server active, or
> with invalid .Xauthority. You'll get some sort of error message - on
> the console. Which means that somewhere in the GUI library, there's
> fall-back code that produces console output. That's why I say it's the
> most basic of all forms of that fundamental of programming, producing
> output that a human can read. It's the simple one that you teach
> first; everything else is built on that.
Seeing the unix-centricity of this -- What's .Xauthority?? --
reminds me of this story/joke (apocryphal) that floats around the net.
Word Perfect helpline story: Customer support officer was sacked
because of the following conversation
Customer Support: Ridge Hall computer assistant; may I help you?
Caller: Yes, well, I'm having trouble with WordPerfect.
CS: What sort of trouble?
C: Well, I was just typing along, and all of a sudden the words went away.
CS: Went away?
C: They disappeared.
CS: Hmm. So what does your screen look like now?
C: It's blank; it won't accept anything when I type.
CS: Are you still in WordPerfect, or did you get out?
C: How do I tell?
CS: Can you see the C: prompt on the screen?
C: What's a sea-prompt?
CS: Never mind. Can you move the cursor around on the screen?
C: There isn't any cursor, I told you, it won't accept anything I type.
CS: Does your monitor have a power indicator?
C: What's a monitor?
CS: It's the thing with the screen on it that looks like a TV. Does
it have a little light that tells you when it's on?
C: I don't know.
CS: Well, then look on the back of the monitor and find where the
power cord goes into it. Can you see that?
C: Yes, I think so.
CS: Great. Follow the cord to the plug, and tell me if it's plugged
into the wall.
C: .......Yes, it is.
CS: When you were behind the monitor, did you notice that there were
two cables plugged into the back of it, not just one?
CS: Well, there are. I need you to look back there again and find the
C: .......Okay, here it is.
CS: Follow it for me, and tell me if it's plugged securely into the
back of your computer.
C: I can't reach.
CS: Uh huh. Well, can you see if it is?
CS: Even if you maybe put your knee on something and lean way over?
C: Oh, it's not because I don't have the right angle - it's because it's dark.
C: Yes - the office light is off, and the only light I have is coming
in from the window.
CS: Well, turn on the office light then.
C: I can't.
CS: No? Why not?
C: Because there's a power outage.
CS: A power... A power outage? Ah, Okay, we've got it licked now. Do
you still have the boxes and manuals and packing stuff your computer
C: Well, yes, I keep them in the closet.
CS: Good. Go get them, and unplug your system and pack it up just
like it was when you got it. Then take it back to the store you bought
C: Really? Is it that bad?
CS: Yes, I'm afraid it is.
C: Well, all right then, I suppose. What do I tell them?
CS: Tell them you're too stupid to own a computer.
Yeah its funny... But it tells a serious story in the context of this thread.
We make a large number of assumptions which may seem obvious to some and not
to others -- "Machine is powered on" is of course an extreme.
One can think of more such. eg for running a python ..
1. We need a machine. What is "machine"? Washing machine? No computer!
Will IBM 360 do? EDSAC?
*&*(&^%$# I mean a reasonably modern computer!
The most modern and widespread computing devices are smartphones. Will that do?
Ok so lets assume that the not exactly trivial question "What is an
appropriate machine for running python?" has been settled (And its
powered on!) Is that enough?
2. I am playing around with the "rm" command. So I rm /lib/x86_64-linux-gnu/libc.so.6
<choose your response>
3. Ok so I have a 'running' system. And its asking me for something
called a login and password
4. Running system. Python script not running. Is python installed?
All of which is to say that for meaningfully discussing python we make
a fairly large number of assumptions.
You assume that this thing called bash/cmd is a given.
What is bash? An OS-level REPL.
[Linux-kernel programmers cant assume such]
If we can assume all the above, how much extra is it to
assume one more level of REPL called 'python'?
And what are the pedagogic advantages to this assumption?
More information about the Python-list