Modified IDLE

23 Sep, 2018

Dean B writes:

I'm on page 137 of your book Python For Kids (chapter 10). I noticed a sentence at the top of the page, and have a question on it. It says "This won't work if you're using the modified version of IDLE that we set up in Chapter 1." I didn't remember seeing anything in chapter 1 on a modified version of IDLE. I looked back through chapter 1, but still don't see anything on the matter.

Would you please tell me what page that is on? I'm more curious than anything. I was frustrated with the "New File" window so I did a search and found IDLEX extensions and installed that. It works quite well for me. I would like to know though how your modified version works.

I'm new to programming and after searching for a good programming language to start with I chose Python, and after looking through a lot of books I chose your book "Python For Kids". I’m a senior citizen and have found this book to be a great introduction to Python. Certainly not just for kids as long as the adults are okay with the kid like context. Works for me, and thanks for such a good book.

Apologies for the confusion there -- this was a miss when we updated the book for later versions of Python 3. When Python for Kids was released in 2013 (end of 2012), you needed to make a minor modification to the shortcut used for starting up IDLE, to turn off "subprocess mode". Without going into too much detail about what that is, effectively if you ran IDLE with subprocess mode on, some of the graphical examples (tkinter, etc) would cause the Shell to hang. This was fixed in a later version of the IDLE runtime, and I removed those instructions from the first chapter on installation -- but completely missed the reference on page 137. Thanks very much for letting me know and I've updated the errata here.


Left and right, or top and bottom

14 Dec, 2013

Matthias writes:

My name is Matthias and I am 7 years old and I like Python. I knew a little about Python before I read your book, but I am learning more by reading your book. I like your book.

I think on page 202 is a little mistake. You wrote:

"We'll use this new object variable in the draw function to see if the ball has hit the top or bottom of the canvas:"

Shouldn't it be "left or right sides of the canvas" instead?

Hi Matthias. You're doing well to have gotten as far as you have, at 7 years of age. Well done!

You're absolutely right about the mistake, and I've updated the errata accordingly. Thanks very much for the "bug report". ツ


PFK Errata

20 Feb, 2013

Piotr Słowik writes:

I'm learning how to code from your book. It's great! First time in my life I'm starting to understand how to write code and make it work ;) You're the first person whose teachings make sense to me!

But I have problem with this example:

>>> v = sys.stdin.readline(13) He who laughs last thinks slowest >>> print(v) He who laughs

Whatever I do I get this error:

readline() takes 1 positional argument but 2 were given

I'm using Python 3.3. Please, help.

Thanks for the email Piotr. It looks like you've found the first 'bug' in the book. That example definitely works -- but it doesn't work in the Python Shell. If you try in the Console, you won't get the error.

The reason for the difference is that the Shell does some magic to replace the stdin object with a version of its own -- and its version of the readline function doesn't have a parameter for the maximum number of characters (hence you get an unexpected error message).

I've added this to the errata page accordingly.