[Tutor] Understanding the tutorial
Kermit Rose
kermit at polaris.net
Tue Feb 21 20:38:23 CET 2006
From: Danny Yoo
Date: 02/20/06 19:22:23
To: Kermit Rose
Cc: Tutor; John Fouhy
Subject: Re: [Tutor] Generating small random integer
>
The thing I'm slightly worried about is that the questions you're asking
seem answered directly by the tutorials we're pointing you to. If there
is something in the tutorials that's inscrutable, please talk about those.
Perhaps we can improve the documentation if we can get an idea why it's
not working for you.
*****************
You do make a fair request.
I'll make some comments about the primary tutorial.
*****
Python Tutorial
Guido van Rossum
Python Software Foundation
Email: docs at python.org
Fred L. Drake, Jr., editor
Release 2.4.2
28 September 2005
*******
Having the table of contents as hyperlinks is very good for using it as
reference text. Thanks for that.
****
2.1 Invoking the Interpreter
*******
is written with the unix programmer in mind.
I do understand some unix, since I used to work on a unix system. But now
the only system
I have available is Microsoft windows.
In windows I invoke the interpreter by clicking on the Python icon, or by
selecting from the program list menu.
******
2.1.1 Argument Passing
*******
Since I do have some unix experience, I understand the idea of a script file
but even so, it's not clear what
should be in a Python script file.
Having some sample scripts in hyperlinks would be very useful.
The sample scripts could illustrate the different options and several simple
Python commands by
doing trivial programming tasks like
Calculating powers of 3,
Calculating square and square root table
Sorting list by bubble sort method, etc.
Then these sample scripts could be referenced throughout the tutorial at the
relevant places.
********
2.1.2 Interactive Mode
*******
I understand this section. And I know how to do experiments in interactive
mode to see what Phython does.
So far, the interactive mode has been more useful to me than the tutorial.
Perhaps as I gradually learn the Python philosophy and vocabulary, I'll more
easily read
the current tutorial.
*******
2.2.1 Error Handling
*****
I skipped over this paragraph since I had not yet encountered any errors
because I had not yet
written any programs.
********
When an error occurs, the interpreter prints an error message and a stack
trace. In interactive mode, it then returns to the primary prompt; when
input came from a file, it exits with a nonzero exit status after printing
the stack trace. (Exceptions handled by an except clause in a try statement
are not errors in this context.) Some errors are unconditionally fatal and
cause an exit with a nonzero exit; this applies to internal inconsistencies
and some cases of running out of memory. All error messages are written to
the standard error stream; normal output from executed commands is written
to standard output.
********
I observed this when my program caused errors.
******
Typing the interrupt character (usually Control-C or DEL) to the primary or
secondary prompt cancels the input and returns to the primary prompt.2
1Typing an interrupt while a command is executing raises the
KeyboardInterrupt exception, which may be handled by a try statement.
*********
2.2.2 Executable Python Scripts
********
Is written with unix programmer in mind. I imagine the windows programmer
should use the dos prompt
for the equivalent. Or perhaps there is some way to invoke the script from
the Python shell.
Examples should be given.
*********
2.2.3 Source Code Encoding
*****
At this point I just about gave up reading from cover to cover.
I have no idea what this paragraph is talking about.
Perhaps examples would have made the meaning clear.
Anyway, I continued scanning the tutorial, pausing when I read a section
I already knew something about.
So I learned that the Python shell can be used as a calculator, and learned
that
almost all the arithmetical expressions I'm used to from programming in
fortran
and C are valid in the shell.
I did not find out how to write programs in the shell from reading the
tutorial. I needed your on line
assistance to find out how to do that.
Anyway, these are a few comments about the tutorial.
I am willing to continue with my critique of the tutorial if you wish. We
could have
an ongoing dialogue, taking the tutorial one small piece at a time.
For I do wish to understand all of it, for I wish to write other programs
in Python,
eventually using all the capabilities of Python.
Sincerly,
Kermit < kermit at polaris.net >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060221/5742997b/attachment-0001.html
More information about the Tutor
mailing list