[Tutor] Very basic Python question

2009-06-26 Thread Daniel Sato
Hi,

Let me preface this by saying that I purchased O'Reilly's "Learn Python"
yesterday and have no programming experience (I am a photographer by trade)
except for a semester of what I think was BASIC on some old apple back in
elementary school (circa 1992).

I am not sure what details are relevant, so I will try and include as much
as possible.  I have a MacBook Pro running Mac OSX 10.5.6.  I recently dl'ed
MacPython 2.5, which installed Python 2.5.4 on my system.

When I am in the terminal, I can run a module by typing python
fullpath/to/script.py

However, when I enter Python from the terminal, by typing python, I can no
longer import items in this way unless the .py file is in my user folder
/Users/Me.  How can I change my settings so that I can import .py files from
a separate directory such as /Users/Me/Documents/PyMods?

Thank you.

-daniel sato

-- 
Daniel Sato
http://www.danielsato.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Very basic Python question

2009-06-26 Thread Daniel Sato
Oh, I thought that you could install multiple instances of Python. I recall
reading somewhere that they advised installing the latest stable version b/c
the one that comes with Apple is often out-dated (as it is whatever version
existed when the your particular model came out).



On Fri, Jun 26, 2009 at 10:16 PM, Luke Paireepinart
wrote:

> Daniel Sato wrote:
>
>> Hi,
>>
>> Let me preface this by saying that I purchased O'Reilly's "Learn Python"
>> yesterday and have no programming experience (I am a photographer by trade)
>> except for a semester of what I think was BASIC on some old apple back in
>> elementary school (circa 1992).
>>
>> I am not sure what details are relevant, so I will try and include as much
>> as possible.  I have a MacBook Pro running Mac OSX 10.5.6.  I recently dl'ed
>> MacPython 2.5, which installed Python 2.5.4 on my system.
>> When I am in the terminal, I can run a module by typing python
>> fullpath/to/script.py
>>
>> However, when I enter Python from the terminal, by typing python, I can no
>> longer import items in this way unless the .py file is in my user folder
>> /Users/Me.  How can I change my settings so that I can import .py files from
>> a separate directory such as /Users/Me/Documents/PyMods?
>>
>
> Hi Daniel,
> You should try uninstalling MacPython.  Macintosh computers come with
> Python preinstalled and you should try to use that version instead.
>  Probably what happened was that, when installing the other version of
> Python, you messed up some of the references for the paths of libraries and
> such.
>
> If that doesn't work, look for an article on upgrading Python on a mac, it
> should detail how to fix anything that breaks when you install MacPython.
> Good luck, and let us know if you have any other problems!
>
>


-- 
Daniel Sato
http://www.danielsato.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] GASP on OSX 10.5.6

2009-06-29 Thread Daniel Sato
Hi,

I am a complete python beginner.  I have been going through How to Think
Like A Computer Scientist 2nd edition online and have come across installing
GASP in chapter 4.  Unfortunately, I can't seem to find much documentation
on how to install GASP when running OSX and Python 2.6.2.  Any help would be
greatly appreciated.

Thanks!

-Daniel

-- 
Daniel Sato
http://www.danielsato.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python Programming exercise

2009-06-30 Thread Daniel Sato
I have been going through some Python Programming exercises while following
the MIT OpenCourseWare Intro to CS syllabus and am having some trouble with
the first "If" exercise listed on this page:

http://en.wikibooks.org/wiki/Python_Programming/Conditional_Statements#If_Exercises

I have been able to make the module quit after entering a password three
times, but can't get it to quit right away after the correct one is
entered.  I know this is really basic, please forgive me.  I have no
programming experience and have just started going through these tutorials.

My code is here:

http://python.pastebin.com/m6036b52e

-- 
Daniel Sato
http://www.danielsato.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor