So I've written my first python program (the ubiquitous 'Hello, World').<br><br>Already, I'm having problems. First, the question I can't find the answer to.<br><br>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." <br><br>In case that won't solve the problem, here are the gory details.<br><br>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.<br><br>
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:<br><br>>>> hello.py<br>
Traceback (most recent call last):<br> File "<stdin>", line 1, in ?<br>NameError: name 'hello' is not defined<br>>>> <br><br>When I run debugger (in TextWrangler) I get the following:<br>
<br>Traceback (most recent call last):<br> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/pdb.py", line 9, in ?<br> import cmd<br> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/cmd.py", line 48, in ?
<br> import string<br> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/string.py", line 83, in ?<br> import re as _re<br> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/re.py", line 5, in ?
<br> from sre import *<br> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sre.py", line 97, in ?<br> import sre_compile<br> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sre_compile.py", line 17, in ?
<br> assert _sre.MAGIC == MAGIC, "SRE module mismatch"<br>AssertionError: SRE module mismatch<br>logout<br>[Process completed]<br><br><br>All help gratefully taken with both hands!<br><br>Alex<br><br><br>