[Tutor] Learning programming
John Kleinjans
johnk@meta3.net
Sun, 04 Apr 1999 09:16:25 -0500
At 03:58 PM 4/3/99 +0200, you wrote:
>
>
>John Kleinjans wrote:
<big snip>
>This is fine so far. Although under PythonWin, things
>are easier:
Looks like PythonWin is the easy answer.
>You have an MDI window with an interpreter shell
>and any number of source files.
>
>I used to type some single lines. After figuring out
>the basics, I open an editor window
... sounds similar to what I found.
>and move the lines
>over, starting to write functions. Instead of importing
>that, I almost write a main program which defines
>a couple of functions, and simply run it.
How does one "write a mian program ... and simply
run it" without importing it?
>This gives
>a very small turn-around time since PythonWin does
>an automatic save for me.
>
>I also quite often use my pylog.py logger, to get
>a transcript of my session and edit it as a Python
>file. You can find it at
>http://starship.python.net/crew/pirx/pylog.py
>
>It will keep a record of "the goods" (the non-failing
>commands) and also allows you to replay sessions to
>your students.
>
>> Beginning programmers would take a very long time to figure this out.
>> They'd probably quit first.
>
>Depending on your courses environment, you should provide
>them with a three page handout which simply shows these
>basic steps.
>Fire up some shell
>Run some commands and inspect the resulting objects
>Save some functions as a Python file
Gotcha.
>and so on. I think it makes sense to let the instructor
>do this, instead of having these recipes ready-made
>for every platform. But that's just my opinion, since
>I have been an autodidact for ages.
I teach myself, too. It's a real push, and I get tired, and I
could probably teach myself faster with a bit of help.
>
>> Please tell me; am I doing this the hard way? Or is this the way?
>
>One of the right ways, of course.
>You could also decide to use Idle, Guido's Tk based
>delevopment GUI, which is already quite usable.
>I personally still prefer PythonWin, and I even use it
>to edit Python files on one of our Linux boxes.
>PythonWin is the editor, and the test bed for non-Unix-specific
>functions. For the rest, I have a telnet screen where I always
>fire the same python command line off for testing.
>
>> We should probably provide more detailed instructions for users of DOS,
>> Macs, even Windows. Realistically, that's what's running on most boxes
>> out there... there's a lot of kids with W95 (or even W311, or DOS) boxes
>> who would like to learn how to program.
>
>So here is the point. What Python still lacks (together with
>most other languages) is support for the absolute beginner.
>It is simply not there. Python is in good neighborship here,
>but anyway it should of course take the chance to become
>a beginner's language.
>
That's the outcome that I'm risking my time on.
>> So now, of course, the newbie has to write a program like ...
>>
>> print "Hello world\n"
>>
>> ... and get that running. And that is the big hurdle for someone who is
>> learning how to program for the very first time. Even in Python.
>
>Not quite.
>The absolute beginner does not need a Python script in the
>first place. What you should teach him on any platform
>is something like:
>(DOS example)
>
>Run Python:
>start a DOS shell and then type
>c:\python>python
>
>then see how to use it as a calculator:
>>>> 1+1
>2
>>>>
>
>Form there on, continue.
Right. Did that.
>The best experience for newbies is that
>they can use Python immediately. Of course this enthusiasm
>will diminish when they recognize that under DOS, the command
>line cannot be retrieved again. SO they will quickly want to use
>file, or PythonWin.
Did that, too.
>Different on Linux, there you have the full history of your
>session available, and you can recall lines and edit them.
>
>Again a word on documentation: The tutorial which comes
>with the standard distribution as a bunch of HTML files
>already contains sample sessions for the very beginning.
>Have a look at file:///D|/Python/Doc/tut/interactive.html
>in the tutorials HTML.
>Then, using Python as a calculator is also there:
>file:///D|/Python/Doc/tut/numbers.html
>
Did. Done.
>And so on. Maybe the standard docs are not too easy to
>become familiar with, but if you know where to look,
>almost everything is there.
>
>I hope you stay with Python - chris (teaching companies:)
>
>--
>Christian Tismer :^) <mailto:tismer@appliedbiometrics.com>
>Applied Biometrics GmbH : Have a break! Take a ride on Python's
>Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net
>10553 Berlin : PGP key -> http://wwwkeys.pgp.net
>PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
> we're tired of banana software - shipped green, ripens at home
>