[Tutor] Problem with "Hello, World"

Alexander Dering alex.dering at gmail.com
Sat Apr 28 12:49:27 CEST 2007

So I've written my first python program (the ubiquitous 'Hello, World').

Already, I'm having problems. First, the question I can't find the answer

Where (exactly) am I supposed to save my files? When I wrote "hello.py"
there was no clearly stated "Make sure you save it HERE or else Python won't
know where to look for it."

In case that won't solve the problem, here are the gory details.

I wrote "hello.py" with TextWrangler. I can get it to run from TextWrangler
by clicking on the "run in terminal" command. And it runs beautifully. A
masterful demonstration of my ability to follow directions.

But I can't get it to run directly from Python. If I go to the terminal and
type "python hello.py" (which is what the instructions say I should be
doing!) I get the following:

>>> hello.py
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'hello' is not defined

When I run debugger (in TextWrangler) I get the following:

Traceback (most recent call last):
line 9, in ?
    import cmd
line 48, in ?
    import string
line 83, in ?
    import re as _re
line 5, in ?
    from sre import *
line 97, in ?
    import sre_compile
line 17, in ?
    assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch
[Process completed]

All help gratefully taken with both hands!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070428/3eca5f25/attachment.htm 

More information about the Tutor mailing list