Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'python.': 0.02; 'subject:Python': 0.06; 'turtle': 0.07; 'structure,': 0.09; 'try:': 0.09; 'val': 0.09; 'wrapper': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; '"from': 0.16; 'dict': 0.16; 'script,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'things.': 0.19; 'examples': 0.20; 'programming': 0.22; 'import': 0.22; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'directory.': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; 'script': 0.25; 'url:edu': 0.26; 'defined': 0.27; 'skip:_ 20': 0.27; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'usually': 0.31; 'keyerror:': 0.31; 'universal': 0.31; "user's": 0.31; 'class': 0.32; 'beginning': 0.33; 'except': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'idle': 0.36; 'done': 0.36; 'experience,': 0.37; 'too': 0.37; 'two': 0.37; 'needed': 0.38; 'skip:- 10': 0.38; 'little': 0.38; 'skip:x 10': 0.40; 'how': 0.40; 'days': 0.60; 'skip:t 30': 0.61; 'simple': 0.61; 'email addr:gmail.com': 0.63; 'teaching': 0.64; 'home': 0.69; 'legal': 0.71; 'subject:For': 0.78; 'age': 0.80; 'as:': 0.81; '#1:': 0.84; '#2:': 0.84; '(10': 0.84; 'dict,': 0.84; 'examples.': 0.84; 'do:': 0.91; 'subject:Make': 0.91; 'choice.': 0.93; 'notebook': 0.96; 'taught': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iTuRSn2bnPlrR/ueLn+SFmWOg5xFCGDqDZbK4QnOWSE=; b=oQ7630Bd7Rx22llLIZL3mCtFN/GDOPczsp6xQORlP0UKCQ+nHcJhY7gT/FbNRUQ6LC KLtMZyglWui1ohyK/4ylLhzmpCxq4OW0quguLg2fffyIE3XZBu9AuP5Cq0JEUhxajTu8 EpjCdnRLOchHW1V/1bMzYYEZ/Kq+EJKpXjbFrG8VxUr6RLAo9hTBrw/FigOiTbj/kPEV CVQwEstel8IInOP5bgkUoIQn7633wRT9U5s268G48lQ/RaQsVAn0/aHRXIrBdrMGI4Kp KWpnkHzjnCv2ihghsUpBkiEeVxVfXgOi/b2FOZ8/q/JWPLumAXgFOdkUhw61QFwFviSP mJQQ== MIME-Version: 1.0 X-Received: by 10.42.65.3 with SMTP id j3mr4843011ici.65.1407238577995; Tue, 05 Aug 2014 04:36:17 -0700 (PDT) In-Reply-To: <7ef67ccc-3fc3-47dd-b858-09ef3b57a497@googlegroups.com> References: <7ef67ccc-3fc3-47dd-b858-09ef3b57a497@googlegroups.com> Date: Tue, 5 Aug 2014 07:36:17 -0400 Subject: Re: 3 Suggestions to Make Python Easier For Children From: Brian Blais To: Mark Summerfield Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407238587 news.xs4all.nl 2928 [2001:888:2000:d::a6]:53767 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 5323 X-Received-Body-CRC: 1674383003 Xref: csiph.com comp.lang.python:75726 On Sat, Aug 2, 2014 at 2:45 AM, Mark Summerfield wrote: > Last week I spent a couple of days teaching two children (10 and 13 -- too big an age gap!) how to do some turtle graphics with Python. Neither had programmed Python before -- one is a Minecraft ace and the other had done Scratch. When I've taught children (and adults!) with little programming experience, I usually have a single import for all the things I want them to use, something like: from my_defined_functions import * at the beginning of every script, usually named for the class I'm teaching. > > Suggestion #1: Make IDLE start in the user's home directory. I use the iPython Notebook now for these things. > > Suggestion #2: Make all the turtle examples begin "from turtle import *" so no leading turtle. is needed in the examples. > in my universal import script I have the turtle imports, usually with both from turtle import * and import turtle, so I have a choice. > Suggestion #3: Make object(key=value, ...) legal and equiv of types.SimpleNamespace(key=value, ...). I also make a data structure, a simple wrapper around dict, which I call Struct, defined as: class Struct(dict): def __getattr__(self,name): try: val=self[name] except KeyError: val=super(Struct,self).__getattribute__(name) return val def __setattr__(self,name,val): self[name]=val then I can do: x=Struct(a=5,b=10) x.c=50 x['this']='that' # or access like a dict bb ----------------- bblais@gmail.com http://web.bryant.edu/~bblais