<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="IncrediMail 1.0" name=GENERATOR></HEAD>
<BODY style="BACKGROUND-POSITION: 0px 0px; FONT-SIZE: 12pt; MARGIN: 5px 10px 10px; FONT-FAMILY: Arial" bgColor=#ffffff background="" scroll=yes ORGYPOS="0">
<TABLE id=INCREDIMAINTABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD id=INCREDITEXTREGION style="FONT-SIZE: 12pt; CURSOR: auto; FONT-FAMILY: Arial" width="100%">
<DIV> </DIV>
<DIV> </DIV>
<DIV id=receivestrings>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>From:</B></I> <A href="mailto:dyoo@hkn.eecs.berkeley.edu">Danny Yoo</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>Date:</B></I> 02/20/06 19:22:23</DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>To:</B></I> <A href="mailto:kermit@polaris.net">Kermit Rose</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>Cc:</B></I> <A href="mailto:tutor@python.org">Tutor</A>; <A href="mailto:john@fouhy.net">John Fouhy</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>Subject:</B></I> Re: [Tutor] Generating small random integer</DIV></DIV>
<DIV> </DIV>
<DIV>> </DIV>
<DIV>The thing I'm slightly worried about is that the questions you're asking</DIV>
<DIV>seem answered directly by the tutorials we're pointing you to. If there</DIV>
<DIV>is something in the tutorials that's inscrutable, please talk about those.</DIV>
<DIV>Perhaps we can improve the documentation if we can get an idea why it's</DIV>
<DIV>not working for you.</DIV>
<DIV> </DIV>
<DIV> *****************</DIV>
<DIV> </DIV>
<DIV>You do make a fair request.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>I'll make some comments about the primary tutorial.</DIV>
<DIV> </DIV>
<DIV>*****</DIV>
<DIV>
<DIV class=titlepage>
<DIV class=center>
<H1>Python Tutorial</H1>
<P><B><FONT size=+2>Guido van Rossum</FONT></B></P>
<P><STRONG>Python Software Foundation</STRONG> <BR>Email: <SPAN class=email>docs@python.org</SPAN> </P>
<P><I>Fred L. Drake, Jr., editor</I></P>
<P><STRONG>Release 2.4.2</STRONG><BR><STRONG>28 September 2005</STRONG></P>
<P></P></DIV></DIV>
<P>
<P><BR>*******</P>
<P>Having the table of contents as hyperlinks is very good for using it as reference text. Thanks for that.</P>
<P>****</P>
<P>2.1 Invoking the Interpreter </P>
<P> </P>
<P>*******</P>
<P>is written with the unix programmer in mind.</P>
<P>I do understand some unix, since I used to work on a unix system. But now the only system</P>
<P>I have available is Microsoft windows.</P>
<P>In windows I invoke the interpreter by clicking on the Python icon, or by selecting from the program list menu.</P>
<P>******</P>
<P>2.1.1 Argument Passing </P>
<P>*******</P>
<P>Since I do have some unix experience, I understand the idea of a script file, but even so, it's not clear what</P>
<P>should be in a Python script file.</P>
<P>Having some sample scripts in hyperlinks would be very useful.</P>
<P>The sample scripts could illustrate the different options and several simple Python commands by </P>
<P>doing trivial programming tasks like</P>
<P>Calculating powers of 3,</P>
<P>Calculating square and square root table</P>
<P>Sorting list by bubble sort method, etc.</P>
<P>Then these sample scripts could be referenced throughout the tutorial at the relevant places.</P>
<P> </P>
<P>********</P>
<P>2.1.2 Interactive Mode </P>
<P>*******</P>
<P>I understand this section. And I know how to do experiments in interactive mode to see what Phython does.</P>
<P>So far, the interactive mode has been more useful to me than the tutorial.</P>
<P>Perhaps as I gradually learn the Python philosophy and vocabulary, I'll more easily read</P>
<P>the current tutorial.</P>
<P>*******</P>
<P>2.2.1 Error Handling</P>
<P>***** </P>
<P>I skipped over this paragraph since I had not yet encountered any errors because I had not yet </P>
<P>written any programs.</P>
<P> </P>
<P>********</P>
<P> </P>
<P>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 <TT class=keyword>except</TT> clause in a <TT class=keyword>try</TT> 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. </P>
<P>********</P>
<P>I observed this when my program caused errors.</P>
<P>******</P>
<P>Typing the interrupt character (usually Control-C or DEL) to the primary or secondary prompt cancels the input and returns to the primary prompt.<A href="mk:@MSITStore:C:\Python24\Doc\Python24.chm::/tut/node4.html#foot123" name=tex2html1><SUP>2.1</SUP></A>Typing an interrupt while a command is executing raises the <TT class=exception>KeyboardInterrupt</TT> exception, which may be handled by a <TT class=keyword>try</TT> statement. </P>
<P>*********</P>
<P>2.2.2 Executable Python Scripts </P>
<P> </P>
<P>********</P>
<P>Is written with unix programmer in mind. I imagine the windows programmer should use the dos prompt</P>
<P>for the equivalent. Or perhaps there is some way to invoke the script from the Python shell.</P>
<P>Examples should be given.</P>
<P>*********</P>
<H2><A name=SECTION004230000000000000000>2.2.3 Source Code Encoding</A> </H2>
<P> </P>
<P>*****</P>
<P>At this point I just about gave up reading from cover to cover.</P>
<P>I have no idea what this paragraph is talking about.</P>
<P>Perhaps examples would have made the meaning clear.</P>
<P>Anyway, I continued scanning the tutorial, pausing when I read a section</P>
<P>I already knew something about.</P>
<P>So I learned that the Python shell can be used as a calculator, and learned that</P>
<P>almost all the arithmetical expressions I'm used to from programming in fortran</P>
<P>and C are valid in the shell.</P>
<P>I did not find out how to write programs in the shell from reading the tutorial. I needed your on line</P>
<P>assistance to find out how to do that.</P>
<P> </P>
<P>Anyway, these are a few comments about the tutorial.</P>
<P>I am willing to continue with my critique of the tutorial if you wish. We could have</P>
<P>an ongoing dialogue, taking the tutorial one small piece at a time.</P>
<P>For I do wish to understand all of it, for I wish to write other programs in Python,</P>
<P>eventually using all the capabilities of Python.</P>
<P> </P>
<P>Sincerly,</P>
<P>Kermit < <A href="mailto:kermit@polaris.net">kermit@polaris.net</A> ></P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></TD></TR>
<TR>
<TD id=INCREDIFOOTER width="100%">
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD width="100%"></TD>
<TD id=INCREDISOUND vAlign=bottom align=middle></TD>
<TD id=INCREDIANIM vAlign=bottom align=middle></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>