Page 1 of 4
Python Projects
Posted: Thu Nov 04, 2021 9:45 am
by richmond62
Re: Python Projects
Posted: Thu Nov 04, 2021 10:25 am
by richmond62
-
-
The 'snag' from the point of view of LiveCode is that is does not come with
a built-in 'Turtle', so we have to supply our pupils with a stack that offers this:
Re: Python Projects
Posted: Thu Nov 04, 2021 10:45 am
by richmond62
Many people love Python because it is easy to read (at least compared to some other programming languages). Being able to read code is a very important skill, just as important as writing it.
Is that a fact?
I would argue that
LiveCode is considerably easier.
-
-

- SShot 2021-11-04 at 11.50.50.png (16.3 KiB) Viewed 22262 times
Re: Python Projects
Posted: Thu Nov 04, 2021 10:53 am
by richmond62
-
I suppose after 20 years of RunRev/LiveCode I have been so "contaminated"
I find that far from welcoming, and it reminds me of my 1981 BBC Model B.
When IDLE starts you will see an Output window called Python Shell. We need to open a new window to write code in. Go to File -> New Window so you’re ready for Step 1. Make sure you have both windows visible.
CRAP!
No such menu item exists:
-
Re: Python Projects
Posted: Thu Nov 04, 2021 11:01 am
by richmond62
A Totally Pointless Exercise:
-

- SShot 2021-11-04 at 11.57.33.png (25.46 KiB) Viewed 22261 times
-
Quite apart from the fact that 'print' seems majorly counter-intuitive
as it does NOT print.
-
Equally pointless exercise:
-
-
"Excuse me, Sir, but WTF does 'Hello World' mean?"
Or, putting things more directly: what pedagogical purpose does that serve?
Congratulations on your first Python program

(PS! You can tell it to print anything you like, why not change it to say hello to you? Change it to say your name instead)
Childish.
Re: Python Projects
Posted: Thu Nov 04, 2021 11:43 am
by richmond62
1. Open a new code window (From the File menu) and write the following:
2. Save your program as myturtle.py and choose Run -> Run Module. See how the turtle moved forward 100 pixels? The turtle has a pen attached, and draws lines as it moves around the screen.
-

- SShot 2021-11-04 at 12.38.43.png (9.12 KiB) Viewed 22246 times
-
This is very odd code to my mind as it doesn't say WHERE (as in, 'from') a 'turtle' might be,
and what '*' might mean (as in, 'import'). The end result is not really very instructive at all, mainly because
I cannot see a turtle:
-

- SShot 2021-11-04 at 12.39.32.png (3.46 KiB) Viewed 22246 times
-
And that arrow turns up in a 3rd window.
Re: Python Projects
Posted: Thu Nov 04, 2021 12:15 pm
by richmond62
Let's set up an initial stack in LiveCode to work with:
-
-
-
In my stack the turtle is VISIBLE.
Re: Python Projects
Posted: Thu Nov 04, 2021 1:04 pm
by richmond62
In some respects it might be better to leave children to enter Turtle Graphics commands into a field:
-
-
Although, to be honest, this teaches them exactly NOTHING about LiveCode
[and, similarly the Python exercise teaches NOTHING about Python, so while
Turtle Graphics may have some value, the ONLY reason I can see of implementing it in
any programming language is to "suck" children into using that language later on.]
-
I asked Wilfred, the plastic turtle we bought at St. Louis zoo (which I can thoroughly recommend)
in 1994, and he couldn't answer that one either.
-
Re: Python Projects
Posted: Thu Nov 04, 2021 4:04 pm
by FourthWorld
richmond62 wrote: ↑Thu Nov 04, 2021 11:01 am
Quite apart from the fact that 'print' seems majorly counter-intuitive
as it does NOT print.
It prints to the screen.
Most languages use it.
What does "put" mean to someone who doesn't already know?
Many function names in languages are somewhat arbitrary. Few are perfect. None are truly intuitive, any more than driving a car is intuitive, though it may subjectively feel that way to one who's been driving a car for many decades.
In October, Python reached the #1 slot on the TIOBE Index. Of course popularity is not necessarily an indicator of quality, but it is an indicator of popularity.
When comparing other languages to LC I used to try to come up with arguments about why the world was wrong. These days I try to ask myself what fans of other languages find attractive. This shift in perspective has taught me more.
LC has many advantages. As does Python. And JavaScript. And all the rest.
There's a reason so many languages exist. And outside of our little corner of the world, most programmers are polyglots.
Re: Python Projects
Posted: Thu Nov 04, 2021 6:00 pm
by richmond62
What does "put" mean to someone who doesn't already know?
Not much.
Re: Python Projects
Posted: Fri Nov 05, 2021 10:11 am
by stam
FourthWorld wrote: ↑Thu Nov 04, 2021 4:04 pm
And outside of our little corner of the world, most programmers are polyglots.
True, true... i suspect to a large extent this is because of the commonalities of C-style OOP languages, which makes it easier to bridge across different languages, whereas LC stands apart conceptually and syntactically (not better or worse, just a bit too different).
Re: Python Projects
Posted: Fri Nov 05, 2021 5:04 pm
by richmond62
LC stands apart conceptually and syntactically
But, arguably, easier to understand by children just because of that.
Re: Python Projects
Posted: Sun Nov 07, 2021 5:21 pm
by richmond62
-
Well, 90 degree turns have already been addressed in the stack posted earlier.
-
Frankly for other turns I cannot be bothered to do that all over again, so I am posting
something I made in 2017:
-
Re: Python Projects
Posted: Sun Nov 07, 2021 5:33 pm
by richmond62
If you are wondering about my design for my buttons; they are loosely based
on those on top of a Valiant Roamer 2 robot:
-
-
and those on a BlueBot robot:
-

- blueB.jpeg (5.61 KiB) Viewed 21652 times
-

- blueBcontrols.jpeg (15.83 KiB) Viewed 21652 times
Re: Python Projects
Posted: Sun Nov 07, 2021 5:35 pm
by richmond62
-
Obviously ALL of this can be managed in my NLCT.livecode
stack.
-
Mind you, my experience is that children will soon get bored with this sort of thing:
-
-
They might be far better to do this sort of thing with a physical 'turtle' of
some sort or other:
-

- vTurtle.jpeg (7.38 KiB) Viewed 21650 times
-