Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread David
On Tue, 5 Feb 2019 at 15:03, David  wrote:
>
> 1) The given title is misleading, in my opinion its subtitle would be much 
> more
> representative: "Enabling students [by] example-driven teaching".

Hi again,

Sorry for replying to myself, but I want to correct something wrong that
I wrote above. The actual subtitle of the presentation is
"Enabling students over example-driven teaching"
and I think the intendend meaning of that is
"Enabling students [is better than] example-driven teaching".

Also I forgot to mention that part of my motivation for writing is some
things Alan wrote:

On Tue, 22 Jan 2019 at 20:59, Alan Gauld via Tutor  wrote:
>
> In the UK many schools use the RaspberryPi project to teach robots to
> kids as part of their Technology courses. The programming is picked up
> by osmosis on an as-needed basis. The upside is that it's a lot of fun
> and gets kids used to the concepts of hardware and software working in
> unison. The downside is that they learn a lot of bad coding habits and
> don't understand the theoretical underpinnings of either the hardware or
> software. But as a way to get them hooked it works well .

On Mon, 4 Feb 2019 at 21:07, Alan Gauld via Tutor  wrote:
>
> I'm not a professional or trained teacher but over
> the last 30 years or so I've been involved in classes
> teaching everything from 11 years to 70+ years old
> students. I've always, without fail, found that some
> students (say 10-20% of a class) just don't get
> programming. It seems to me that some folks just
> don't have their brains wired the right way. It
> doesn't matter what tools or languages you use, it
> even happens with graphical tools like flow charts.
> Some people just don't understand the concepts of
> logical flow and problem decomposition.
>
> You can, of course, force feed these folks to some
> extent and they will pick up the basics with a
> struggle but they will never be able to create
> any significant body of code on their own. I'm
> sure psychologists etc will have an explanation
> for this but I've given up trying to explain it,
> I now just accept that some people don't think
> that way.

I believe the video presentation addresses exactly these points.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread David
On Tue, 22 Jan 2019 at 20:30, Matthew Polack
 wrote:
>
> Hi All,
>
> In our growing school we're teaching Python programming for the first time
> as an elective subject with Year 9 and 10 students. (Had a dabble at this
> last year with 3 students in Year 11)

Hi Matthew and other readers,

I wonder if you and any others here involved in classroom/group teaching
might be interested in this recent presentation that I stumbled across:
https://media.ccc.de/v/35c3-9800-how_to_teach_programming_to_your_loved_ones

The section of this video which motivates me to write here is the two minutes
from 19:00 to 21:00.

What I find most interesting is his motivation mentioned there: he claims his
procedure solves the problem of any students becoming "lost", feeling "stuck"
at any particular step, not knowing what to do next, and unable to proceed
without guidance.

Quoting from the synopsis:
The talk is based on many years of research by the Program by Design,
DeinProgramm, and Bootstrap educational projects, as well as over 30 years
of personal teaching experience in school, university and industrial contexts.
A word of warning: The resulting approach is radically different from most
teaching approaches used in universities and schools. In particular, it avoids
teaching purely through examples and expecting students to develop the
skills to arrive at the solutions on their own. Instead, it teaches explicit
methodology that enables students to solve problems of surprising complexity
on their own, whether they are 11 or 55, whether in a classroom, a training
facility, or your home. Extensive documentation, material, and software to
support this methodology is available for free.

For anyone considering watching the whole presentation, I expect that there
are many other aspects of this presentation to which people here could react
negatively, for example:

1) The given title is misleading, in my opinion its subtitle would be much more
representative: "Enabling students [by] example-driven teaching".

2) It recommends against Python, about this I have no opinion (except
to respect the presenter's experience) and that is not why I am posting it here.

3) It emphasises functional programming style.

4) Despite possibly having an audience including skilled programmers, in the
second half of the presentation the presenter does not skip quickly over the
concept, but instead he chooses to demonstrate his concept by reproducing
the same deliberate steps that he would use in a classroom of students
with low ability.

Despite all these possibly alienating aspects, and possibly others, I'm not
really interested in those aspects, because they're not useful to me and so
I choose to ignore them, instead focussing on what might be useful.

Years ago I spent about a decade teaching undergraduate engineering
students, from that context I consider this interesting and relevant.
This presenter mentions that he has 30 years of of experience
and commitment to teaching this subject, and considers most of his
efforts a "failure" (at 02:00). Learning from such a person can save other
practitioners a great deal of effort.

So I felt that this was worth sharing here, I hope negative reactions
or distractions don't distract from possibly useful information.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Remove soft line break

2019-02-04 Thread Peter Otten
Valerio Pachera wrote:

> 
> I have a file with row that split at the 80th character.
> The next row start with a blank space, meaning that i part of the previous
> row.
> 
> Example:
> 
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non justo
> enim. Viv
>  amus dapibus quis neque vitae ornare. Pellentesque at pharetra sapien, id
>  eleif end lacus. Nullam ut semper enim, vulputate venenatis justo.
>  Vestibulum vehicul a dolor sit amet ultricies vulputate. Aenean lobortis,
>  nulla eu scelerisque hen
> 
> What do you suggest to get the text on a single line?

Neglecting the corner cases:

$ cat mergelines.py 
def merge_lines(lines):
lines = (line.rstrip("\n") for line in lines)
accu = [next(lines)]
for line in lines:
if line.startswith(" "):
accu.append(line[1:])
else:
yield "".join(accu) + "\n"
accu = [line]
yield "".join(accu) + "\n"


SAMPLE =  """\
foo bar baz
  ham spam
alpha beta
  gamma
 delta
  epsilon
""".splitlines(True)

for line in merge_lines(SAMPLE):
print(line, end="")
$ python3 mergelines.py 
foo bar baz ham spam
alpha beta gammadelta epsilon

I hope this isn't homework ;)


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Remove soft line break

2019-02-04 Thread Mats Wichmann
On 2/4/19 10:13 AM, Valerio Pachera wrote:
> 
> I have a file with row that split at the 80th character.
> The next row start with a blank space, meaning that i part of the previous 
> row.
> 
> Example:
> 
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non justo enim. 
> Viv
>  amus dapibus quis neque vitae ornare. Pellentesque at pharetra sapien, id 
> eleif
>  end lacus. Nullam ut semper enim, vulputate venenatis justo. Vestibulum 
> vehicul
>  a dolor sit amet ultricies vulputate. Aenean lobortis, nulla eu scelerisque 
> hen
> 
> What do you suggest to get the text on a single line?

joining the lines is simple - use an empty string as the thing to join
on, and if you want to ditch the beginning space there's a function for
that too (lstrip). But... if you don't have a precise way to know if a
word was split in the middle or on a space (or do you know this?), you
probably need human intervention to reassemble the original.


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Remove soft line break

2019-02-04 Thread Valerio Pachera


I have a file with row that split at the 80th character.
The next row start with a blank space, meaning that i part of the previous row.

Example:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non justo enim. Viv
 amus dapibus quis neque vitae ornare. Pellentesque at pharetra sapien, id eleif
 end lacus. Nullam ut semper enim, vulputate venenatis justo. Vestibulum vehicul
 a dolor sit amet ultricies vulputate. Aenean lobortis, nulla eu scelerisque hen

What do you suggest to get the text on a single line?

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread Mike Barnett
Be cautious when using IDLE with tkinter based programs (PySimpleGUI falls into 
this category).

IDLE is written using tkinter.  You can sometimes end up with tkinter 
complaining about the mainloop running in multiple locations or freeing 
resources in the wrong thread.


@mike

From: Matthew Polack 
Sent: Monday, February 4, 2019 12:15 AM
To: Sean Murphy 
Cc: Mike Barnett ; tutor@python.org
Subject: Re: [Tutor] Recommended Resurce or strategy for beginning students

Hi All,

Firstly thanks so much for all the suggestions a while back re: recommended 
method for Python...really appreciate the ideas.

We had our first lesson today (With 15 year olds) where I started with the 
basic command line..and did a simple "Hello World" type program...just to show 
how something could be run straight from notepad and command line...

We then went to IDLE and made a simple 'Maths Calculator'

All of this went quite well...but as the long session started to wind down (Is 
a double lesson on a Monday)...I did start to notice the following:

1.) One group of students (probably most)..actively problem solving..trying 
things...googling all sorts of ways of improving their code...figuring out new 
ways of doing things...will go a long way.
2.) Another smaller group started to hit the wall...and were struggling for 
internal drive...needed to be 'hand fed'

Is going to be interesting going forward how to both cater for the 'indpendent 
workers' whilst still keeping the 'unenthused unless entertained' group 
engaged! The joys of teaching...but will certainly try some of the suggestions 
mentioned...PySimpleGUI..Turtle graphics etcthey will be very helpful. 
Thanks.



Matthew Polack | Teacher



[Emailbanner3.png]


Trinity Drive  |  PO Box 822

Horsham Victoria 3402

p. 03 5382 2529   m. 0402456854

e. matthew.pol...@htlc.vic.edu.au

w. 
www.htlc.vic.edu.au



On Wed, Jan 23, 2019 at 1:21 PM Sean Murphy 
mailto:mhysnm1...@gmail.com>> wrote:
I like this concept. The only additional information I would add in relation to 
any training or educational information. You must include accessibility. As the 
laws in many countries require this to be a part of the product. So it is a 
perfect time to educate students on this important topic. A high level 
awareness is required only.
Introducing the basics. Keyboard navigation, colour contrast, ensuring the GUI 
works with a screen reader. The platforms used for GUI should do most of the 
heavy lifting.

The other aspect is you need to ensure the course is accessible to possible 
disable students for now and the future. If you are based in the Usa. Then 
there could be legal requirements for this. Not sure. Out of my scope of focus 
in the accessibility world.


A bare minimum is to understand the bare basics which are called POUR. 
Reference W3C for the explaination.

Sean

My experience is the part

> On 23 Jan 2019, at 1:17 am, Mike Barnett 
> mailto:mike_barn...@hotmail.com>> wrote:
>
> I like the idea of starting out right away on a GUI.  I know this is 
> completely backwards to what would normally be taught, but hear me out.  Kids 
> today are used to GUI interfaces.  They're on their phones, their computers, 
> their TV  sets.
>
> Why not teach kids to output to a window instead of a command line?  What if 
> it's just was easy, or easier, to work with a GUI as it is the command line?
>
> To output to the command line in standard Python:
> print('my string', variable1, variable2)
>
> To output the same information to a window using PySimpleGUI:
> Popup('my string', variable1, variable2)
>
> Or, you can "print" to a debug window if that's your thing.
> Print('takes the same parameters as print')
>
> If the ultimate goal is to teach kids about how to design a GUI window, how 
> to lay out a GUI using good user interface design principals, then it would 
> be nice to get the GUI coding out of the way and let the focus instead be on 
> the GUI itself.  This is when having a drag-and-drop Designer Tool is handy.  
> If not, then the next best thing is a simple programming interface.
>
> PySimpleGUI was designed so that the code visually matches the window layout.
>
> It's capable of duplicating pretty much any layout and widget combination 
> that you can create coding directly to tkinter's (or Qt's or WxPython's) 
> interfaces.  PySimpleGUI simply creates and executes the "boilerplate" code 
> that is often brought up when GUIs are discussed.
>
> A goal was to remove all of the boilerplate code and provide a programmer 
> with a simple, friendly and flexible set of APIs.  You write a single line of 
> code per row of widgets in your window plus a 1/2 

Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread Alan Gauld via Tutor
On 04/02/2019 05:14, Matthew Polack wrote:

> We had our first lesson today

Congrats, hope it goes well.
But...

> 2.) Another smaller group started to hit the wall...

I'm not a professional or trained teacher but over
the last 30 years or so I've been involved in classes
teaching everything from 11 years to 70+ years old
students. I've always, without fail, found that some
students (say 10-20% of a class) just don't get
programming. It seems to me that some folks just
don't have their brains wired the right way. It
doesn't matter what tools or languages you use, it
even happens with graphical tools like flow charts.
Some people just don't understand the concepts of
logical flow and problem decomposition.

You can, of course, force feed these folks to some
extent and they will pick up the basics with a
struggle but they will never be able to create
any significant body of code on their own. I'm
sure psychologists etc will have an explanation
for this but I've given up trying to explain it,
I now just accept that some people don't think
that way.

It's a bit like math. Some people don't get that
either. They can learn Pythagoras' theorem and
that it applies to right angled triangles and
that triangles have 3 sides and that it is right
angled if one corner is 90 degrees. But turn such
a triangle on its side and they can no longer see
the right angle, and don't understand how turning
it around doesn't change the size of the angles etc.
It just doesn't make any sense to them. And it
seems the same is true for programming logic.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Recommended Resurce or strategy for beginning students

2019-02-04 Thread Matthew Polack
Hi All,

Firstly thanks so much for all the suggestions a while back re: recommended
method for Python...really appreciate the ideas.

We had our first lesson today (With 15 year olds) where I started with the
basic command line..and did a simple "Hello World" type program...just to
show how something could be run straight from notepad and command line...

We then went to IDLE and made a simple 'Maths Calculator'

All of this went quite well...but as the long session started to wind down
(Is a double lesson on a Monday)...I did start to notice the following:

1.) One group of students (probably most)..actively problem solving..trying
things...googling all sorts of ways of improving their code...figuring out
new ways of doing things...will go a long way.
2.) Another smaller group started to hit the wall...and were struggling for
internal drive...needed to be 'hand fed'

Is going to be interesting going forward how to both cater for the
'indpendent workers' whilst still keeping the 'unenthused unless
entertained' group engaged! The joys of teaching...but will certainly try
some of the suggestions mentioned...PySimpleGUI..Turtle graphics
etcthey will be very helpful. Thanks.


Matthew Polack | Teacher


[image: Emailbanner3.png]

Trinity Drive  |  PO Box 822

Horsham Victoria 3402

p. 03 5382 2529   m. 0402456854

e. matthew.pol...@htlc.vic.edu.au

w. www.htlc.vic.edu.au


On Wed, Jan 23, 2019 at 1:21 PM Sean Murphy  wrote:

> I like this concept. The only additional information I would add in
> relation to any training or educational information. You must include
> accessibility. As the laws in many countries require this to be a part of
> the product. So it is a perfect time to educate students on this important
> topic. A high level awareness is required only.
> Introducing the basics. Keyboard navigation, colour contrast, ensuring the
> GUI works with a screen reader. The platforms used for GUI should do most
> of the heavy lifting.
>
> The other aspect is you need to ensure the course is accessible to
> possible disable students for now and the future. If you are based in the
> Usa. Then there could be legal requirements for this. Not sure. Out of my
> scope of focus in the accessibility world.
>
>
> A bare minimum is to understand the bare basics which are called POUR.
> Reference W3C for the explaination.
>
> Sean
>
> My experience is the part
>
> > On 23 Jan 2019, at 1:17 am, Mike Barnett 
> wrote:
> >
> > I like the idea of starting out right away on a GUI.  I know this is
> completely backwards to what would normally be taught, but hear me out.
> Kids today are used to GUI interfaces.  They're on their phones, their
> computers, their TV  sets.
> >
> > Why not teach kids to output to a window instead of a command line?
> What if it's just was easy, or easier, to work with a GUI as it is the
> command line?
> >
> > To output to the command line in standard Python:
> > print('my string', variable1, variable2)
> >
> > To output the same information to a window using PySimpleGUI:
> > Popup('my string', variable1, variable2)
> >
> > Or, you can "print" to a debug window if that's your thing.
> > Print('takes the same parameters as print')
> >
> > If the ultimate goal is to teach kids about how to design a GUI window,
> how to lay out a GUI using good user interface design principals, then it
> would be nice to get the GUI coding out of the way and let the focus
> instead be on the GUI itself.  This is when having a drag-and-drop Designer
> Tool is handy.  If not, then the next best thing is a simple programming
> interface.
> >
> > PySimpleGUI was designed so that the code visually matches the window
> layout.
> >
> > It's capable of duplicating pretty much any layout and widget
> combination that you can create coding directly to tkinter's (or Qt's or
> WxPython's) interfaces.  PySimpleGUI simply creates and executes the
> "boilerplate" code that is often brought up when GUIs are discussed.
> >
> > A goal was to remove all of the boilerplate code and provide a
> programmer with a simple, friendly and flexible set of APIs.  You write a
> single line of code per row of widgets in your window plus a 1/2 dozen
> lines to implement the event loop.
> >
> > I don't see the harm in approaching the problem from a different
> direction.  It could be wildly successful.  Or... not...  The worst that
> can happen is you screw up a classroom full of future programmers, creating
> a warped vision that GUIs can be fun and easy.
> >
> >
> > @mike
> >
> > -Original Message-
> > From: Matthew Polack 
> > Sent: Tuesday, January 22, 2019 1:58 AM
> > To: tutor@python.org
> > Subject: [Tutor] Recommended Resurce or strategy for beginning students
> >
> > Hi All,
> >
> > In our growing school we're teaching Python programming for the first
> time as an elective subject with Year 9 and 10 students. (Had a dabble at
> this last year with 3 students in Year 11)
> >
> > I'm wondering what specific resource or