I do not know what I did wrongly in emacs to cause the problem
There is a good chance it was not emacs, but rather what changes you made to the .profile, which could have been a misunderstanding of what you were being asked to do, or just bad instructions. I am not a Python user, but looking briefly at a Python docs, I would say it would look something like this:
export PYTHONPATH=/path/to/dir:$PYTHONPATH
There is ONLY 1 space between 'export' and PYTHONPATH, and not other spaces in the 'export' statement.
But I suspect your instructions had you do more than just setting PYTHONPATH, because even a broken export statement should not have caused what you were seeing
A colleague has also recommended that I not use emacs, so I will look at Textwrangler.
TextWrangler is a great app to have in your toolbox. But if you intend to spend a lot of time in a Terminal, you may decide at a later date to use a terminal based editor.
nano is a very simple editor that easy for novice users to start with and for simple edits.
My personal preferences is for the vim editor, it has a steep learning curve, but it is used by a lot of professional Unix programmers. The best way to get started with vim is vimtutor
/usr/bin/vimtutor
Just run vimtutor and follow the instructions.
emacs is a very good editor that a huge segment of the Unix programming world lives in (and I do mean Lives in, as emacs has been described as an operating system disguise as an editor).
Many bits have been killed in editor wars between emacs and vi/vim users. Basically, once you train your fingers to use one of these editors you do not want to switch and you find it strange that anyone would want to use anything except your editor 🙂