dont laugh

Alex Martelli aleaxit at yahoo.com
Sat Sep 2 10:06:25 EDT 2000


"Ian Hobson" <ian.hobson at ntlworld.com> wrote in message
news:1rAlZGAgEEs5Ew4l at ntlworld.com...
    [snip]
> Python MUST run "out of the box" (even on win32 - which it does not) and
> then the ideas can be explained.

What do you mean by "it does not"?  You download a self-installing
executable, run it, and there's a 'Python' entry on the Programs menu
of your Start button (plus, probably, one or more other entry points,
such as IDLE and/or Pythonwin, depending on the contents of said
self-installing executable).  That seems to be pretty much "out of
the box" to me.


> I'm now past my first python prog. The MAJOR hurdles that I have crossed
> include
>
> a) Understanding that "Name error" meant I had forgotten an import line.

That's not something that would be necessarily any easier for the
interpreter to figure out for you.  Say you use a name it doesn't
know, such as 'foo'; how could it tell whether
a) it's a typo for some name it does know, such as 'food'
b) you forgot to "from bar import foo"
c) you forgot to "import foo"
d) you forgot to say "foo=23" earlier
e) you forgot case matters, and mean 'Foo' or 'FOO'
or other causes yet?  "Name error" seems appropriately generic for
an error which could be due to so many disparate causes.


> b) Understanding that syntax error meant I had missed a :

Here, I guess, the compiler _could_ be more helpful, specifically
mentioning the missing colon.

>>> if 1>2
Traceback (  File "<interactive input>", line 1
    if 1>2
          ^
SyntaxError: invalid syntax
>>>

The compiler does know what it's expecting, in this case, so
it could be more helpful about why that syntax is invalid.


> c) Getting the resulting program to run from the start menu!

I guess that's not something the typical newbie would attempt;
those who do want it may know it's just an issue of setting a
shortcut appropriately (e.g., right-button/Explore on the Start
menu, navigate to the apropriate subfolder, right-button/New/
Shortcut, enter the commandline you desire, possibly edit the
Properties of the resulting shortcut; strictly an issue of Windows
GUI).  Do you think automating these tasks would greatly
enhance Python's accessibility for newbies?  I'm dubious, since
no major programming environment I know of for Windows
does it, not even Visual Basic I believe...


Alex






More information about the Python-list mailing list