[Tutor] Problem with "Hello, World"
Rikard Bosnjakovic
rikard.bosnjakovic at gmail.com
Mon Apr 30 17:15:31 CEST 2007
On 4/28/07, Alexander Dering <alex.dering at gmail.com> wrote:
> 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
> >>>
What you are doing above is typing "python", then - IN python - typing
"hello.py". This does not work, since you're in the interpreter and
the function "hello.py" is unknown to Python.
So try again: "python hello.py" in the command interpreter. Or if you
are in the python interpreter, you might try "import hello" and see
what happens.
--
- Rikard - http://bos.hack.org/cv/
More information about the Tutor
mailing list