My son is 11 and wants to try programming, partly because it's what I
do for a living. Even though I don't (yet?) use or even know Python,
through some unexplainable thought process I've decided it would be a
good language to start him off with. I've downloaded 2.2.2 and played
around with it for a bit, and I would now like to hand him a book
(with my guidance as needed) and say "go have fun!" Is there a book
that would be suitable for this approach (again, assuming I'm around
to help out as needed)?
One other question -- I'd like him to be able to do simple graphics
fairly early, since I think it makes the whole self-learning process
much more interesting. I'm talking about things like points, lines,
circles, fills, etc. Is there a binding to the Win32 graphics
primatives in 2.2.2, or can I find one someplace? If this is a RTFM
question, any pointers to TFM chapter, etc would be appreciated!
Thanks for any guidance. I'm sure I'll end up having at least as much
fun as he does.
Mike
The book by Alan Gauld is good.
"Learn to Program Using Python"
The cover says:
"A tutorial for Hobbyist, Self-Starters, and All Who Want to Learn
the Art of Computer Programming"
Bob
Just in case someone from Germany has the same problem: "Python für
Kids" von Gregor Lingl
> One other question -- I'd like him to be able to do simple graphics
> fairly early, since I think it makes the whole self-learning process
> much more interesting. I'm talking about things like points, lines,
> circles, fills, etc. Is there a binding to the Win32 graphics
> primatives in 2.2.2, or can I find one someplace? If this is a RTFM
> question, any pointers to TFM chapter, etc would be appreciated!
Tkinter has a canvas where you can place graphic objects, and add
handlers for mouse clicks to them. These objects can be moved etc.
wxPython can only draw on a canvas, but I think it's easier to get a
printout.
Both toolkits are rated PG, mostly because the documentation is not
suitable for beginning programmers.
Daniel
> Mike Silva wrote:
> > Hi all,
> > My son is 11 and wants to try programming, partly because it's what I
>
> > do for a living. Even though I don't (yet?) use or even know Python,
> > through some unexplainable thought process I've decided it would be a
> > good language to start him off with. I've downloaded 2.2.2 and played
> > around with it for a bit, and I would now like to hand him a book
> > (with my guidance as needed) and say "go have fun!" Is there a book
> > that would be suitable for this approach (again, assuming I'm around
> > to help out as needed)?
>
> Just in case someone from Germany has the same problem: "Python für
> Kids" von Gregor Lingl
Is this book also ok for an 8-year old german speaking?
Thanks,
Thomas
Don't know enough about 8-year olds, but the publisher's web page
http://www.mitp.de/vmi/mitp/?pTyp=detail&pWert=0951
has a PDF of the first chapter, which should be enough for a test.
Daniel
Regarding graphics and GUI i played around with Jython - the Python
implementation in Java that provides for easy access to any Java
package. I combined this with the new Java SWT Windowing Toolkit that
delivers a native platform look & feel to Java and consequently Jython,
too.
Based on this i built a very simple Jython class that wraps SWT to
provide a minimalistic "GUI framework" for Jython/Python. - just the
right thing for a kid to be able to pop-up a window without too much
hassle.
Let me know if you are interested in this
--
Timo
<...>
> One other question -- I'd like him to be able to do simple graphics
> fairly early, since I think it makes the whole self-learning process
> much more interesting. I'm talking about things like points, lines,
> circles, fills, etc. Is there a binding to the Win32 graphics
> primatives in 2.2.2, or can I find one someplace? If this is a RTFM
> question, any pointers to TFM chapter, etc would be appreciated!
OK, in poking around more I discovered Tkinter and the turtle module.
This looks like it will be fine -- certainly kept me entertained for
the last hour!
(If this message comes through as a new thread rather than a followup,
it's a google strangeness happening...)
Mike
I am using turtle graphics as the basis for a book I am writing for
beginning programmers. I do not use Tkinter, but Pygame, as I figure
the students are going to want to do more game-like things soon after
seeing the turtle (actually, I use a penguin ;-) run around the screen.
You can see more about it here:
http://www.nongnu.org/pygsear/
I am still actively writing the book, but you can see what I have
so far linked there. Any feedback is appreciated.
Good luck -- Al C.
> One other question -- I'd like him to be able to do simple graphics
> fairly early, since I think it makes the whole self-learning process
> much more interesting. I'm talking about things like points, lines,
> circles, fills, etc.
I wrote an activex exe which models the VB printer object and is usable from
python on win32. It might, particularly with a little work, allow sufficient
drawing of lines, shapes, and what not. generally, with about 1 line of
code change it will send the drawing to the printer instead of the screen.
it is available from http://www.e-coli.net/software/ecp_printer.shtml
-d
There are good books, though, for Tkinter--Fredrik's
and John's. On the other hand, both are written for
more-or-less experienced programmers ...
--
Cameron Laird <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://phaseit.net/claird/home.html
start = vector(4,7,3)
finish = vector(4,2,3)
box = visual.box(pos=finish, size=(8.,4.,6.), color=color.red)
ball = visual.sphere(pos=start, radius=2, color=color.green)
framespersec = 12
seconds = 15
startink = vector(color.blue)
stopink = vector(color.red)
for i in range(seconds * framespersec):
ball.pos = start + i * (finish-start)/100.
ball.color = startink + i * (stopink-startink)/100.
visual.rate(framespersec)
Running this slowly (in 15 seconds) pushes a blue ball (which
becomes redder over time) into a red box. This is (to my way
of thinking) much more delightful than 2-D because you know how
to draw in 2-D more easily than the computer can, while the
computer can help you sketch in 3-D.
Mike Silva wrote:
> ... I'd like him to be able to do simple graphics fairly early, ...
VPython has primitives for cylinder, arrow (actually kind of clunky),
cone, sphere, and box. In addition, it provides curve and convex
to build up paths and convex polyhedra from point lists. Labels are
similarly easy, but interacting diectly with your shapes is a bit more
challenging.
I am nothing more than an enthusiastic user of VPython (no affiliation,
....)
-Scott David Daniels
Scott....@Acm.Org
The best book for young people to learn Python is:
_How to Think Like a Computer Scientist: Learning with Python_
by Allen B. Downey, Jeffrey Elkner and Chris Meyers
In dead tree form or free off the web:
http://www.ibiblio.org/obp/thinkCSpy/
Jeffrey Elkner is a high school teacher so the book is aimed
at this level. I plan on using this book for an after school
programming club in middle schools (7th-8th grade). You can
read an O'Reilly interview with Jeffrey Elkner here:
http://www.oreilly.com/frank/elkner_0300.html
>
> I'd like him to be able to do simple graphics fairly early ...
The turtle module will let you do turtle graphics.
>>> from turtle import *
>>> demo()
I should mention that I have been using Logo in the afterschool
programming club. Brian Harvey has a three book series:
_Computer Science Logo Style_, and offers a free version of Logo:
http://HTTP.CS.Berkeley.EDU/~bh/
Thanks,
Jeff Sandys
Mike ...
This is NOT a Python solution, but you might take a look
at the Drawing Programming Environment called DRAPE
which was designed with kids in mind ...
http://www.cs.uu.nl/people/markov/kids/drape.html
Drape was written to teach children some basic aspects of programming.
It has some resemblance to Logo but Drape is completely visually oriented.
Children don't need to be able to read.
Like in Logo, programs in Drape create a drawing.
A program in Drape consists of a number of commands.
There are commands that draw lines and shapes,
commands that move to a particular position,
commands that set properties, like color,
line width and size, and control commands,
e.g. to repeat commands, to call procedures,
and to test for mouse buttons.
Each command is represented by a little picture.
A program is a sequence of these pictures.
You create a program by dragging the pictures
to the appropriate place in the sequence.
Cousin Stanley
Sounds like a great tool for younger children, but I think by 11 years
old they're a little above this level. I myself am almost 16, and have
been experimenting with different languages in one way or another
since I was 9 or 10. I started out not knowing were to go, I didn't
have good direction. The internet is a great resource, if you know
where to look. I regret not having the opportunity to use such a
graphical language such as DRAPE when I was younger.
My suggestion to him would be to make an honest attemp to learn
python, its a great starter. The first time I tried to tackle C a few
years back there, I found myself getting bogged down in some of the
aspects of a lower level language. Python is a high level language, it
allowed me to avoid many of these early pitfalls in my programming
experience. It also enabled me to then easily achieve a great working
knowledge of both C and C++.
As you learn one aspect of the language, try to apply it to a
practical problem. APPLY the language. Use it for your homework math
problems and such. I use Python all the time. From writing simple
programs for my own use and/or amusment, to solving complex problems,
I have found my knowledge in programming to be very useful.
A great starting point for Python is the book "Learning Python" by
Mark Lutz and David Ascher ISBN 1-56592-464-9 This is were I started
my journey.