[Pythonmac-SIG] Mac User Python Newbies

Michael Hudson mwh at python.net
Sun Feb 13 18:47:48 CET 2005


Troy Rollins <troy.rollins at gmail.com> writes:

> On Sun, 13 Feb 2005 16:12:13 +0000, Michael Hudson <mwh at python.net> wrote:
>> Troy Rollins <troy.rollins at gmail.com> writes:
>> 
>> > I for one, don't care to think of myself in the context of "begger",
>> > but more so in the context of uninitiated contributor. If developers,
>> > new to python, have a barrier to entry, they may well walk of to Ruby,
>> > or Lua... etc. At some point, I'd like to be contributing to the
>> > effort, but just getting off the ground is a bit daunting.
>> 
>> I may be missing details from earlier posts, but what is currently
>> daunting you?  Have you looked at the Python tutorial or the PyObjC
>> tutorial, to pick two simple examples?
>> 
>
> Well, I've transitioned between tools like Director, REALbasic, and
> Revolution,

Well, I've used exactly none of those, but let's see what I can
do... :-)

> and extremely quickly moved into creating non-trivial
> applications. With Python, it is far less condusive to "playing"

Well, I think this is a subjective judgement -- a matter of
familiarity.  I "play" with Python all the time.  A good start is to
enhance your interactive experience somewhat.  Three options spring to
mind:

 1) Get readline support working.  If you're still using Apple's
    Python, get bbum's readline.so from

        http://homepage.mac.com/bbum/BumFiles/FileSharing27.html

    (is this still the right link?), then add lines like

        try:
            import rlcompleter, readline
            readline.parse_and_bind("tab: complete")
        except ImportError:
            pass

    to a file called something link ~/.pythonrc and point the
    PYTHONSTARTUP environment variable to it (yikes, this is a bit
    involved...).  Then if you want to see what functions a module
    supports you can do:

        >>> import urllib2
        >>> urllib2.url<HERE I HIT TAB>
        urllib2.url2pathname  urllib2.urlopen       urllib2.urlparse

    and so on:

       >>> data = urllib2.urlopen('http://www.google.com').read()
        >>> data[:10]
        '<html><hea'

 2) Install IPython (http://ipython.scipy.org/).  This is a massive
    extension of the above and requires you have readline working.
    I've not used it much, but people like it.  I imagine it has docs
    :)

 3) Install (my) PyRepl package (http://codespeak.net/pyrpl/), which
    is a different implementation of the same kind of thing.

There are less terminal oriented interactive environments too -- I
think wxPython includes one and PyObjC has a 'PyInterpreter' example.
But to me they don't hold much advantage over the in-Terminal.app
solutions.

> and therefore seems to hold me somewhere around the print "hello
> world" stage.

Well, what would you like to do? :) It's often hard to know what to do
with a funky new toy as flexible as Python...

> Yes, I've look at the cited examples... perhaps they simply didn't
> connect with me on the right level.

Well, for some not-exactly-instant-but-quick gratification, I'd
consider playing with PyObjC -- maybe writing a simple image viewer or
something -- though this would involve more time learning about Coca
that Python in all likelyhood.

> Python stuff always seems to be written from the perspective of "ok,
> you are starting from a lower level language",

This is probably a fair comment.  It's certainly the direction I
arrived at Python from...

> but many of us are probably coming from the other direction – a
> higher level language...  Lingo, REALbasic, etc. It would seem to me
> that the transition to Python should be easy, but perhaps I just
> haven't yet encountered the right materials.

I would also offer the advice to stop worrying about materials,
probably.  Pick a (possibly toy) problem and have at it :)

> I just received 3 books on Python from Amazon. Every one of them
> starts with the line "this book does not teach you to program in
> Python, and assumes you already know how to do that." Perhaps it is
> just my own dumb luck, but that is the angle most web materials take
> as well in my experience. OR, it is print "hello world".

Uh, really?  Certainly a lot of books assume you know how to program.

If you don't know that, there's "How to Think Like a Computer
Scientist", urm, hmm... have you read this page:

   http://www.python.org/moin/BeginnersGuide

I was going to copy and paste various stuff from there but I'm not
sure there's a lot of point -- but this section

   Next, you're going to want to read a tutorial and try some simple
   experiments with your new Python interpreter.

       If you've never programmed before, see BeginnersGuide/NonProgrammers.

       If you have previous programming experience, consult
       BeginnersGuide/Programmers, which lists more advanced
       tutorials.

seems appropriate.

> I'm pretty committed to learning this, but I'm somewhat surprised at
> how much productivity I have to throw away in order to do it. Many
> would say "well, that's free software for you." But, I'm not
> interested in the "free" part. Free is not what is important to me.
> Frankly, I'd rather pay for something productive. 

If you're prepared to sling money around there are people and
companies who do Python training, although I don't know much more than
that.  Googling for 'python training' looks optimistic :)

> My time is worth WAY more than whatever a decent tool would
> cost. The part that interests me is open source, and
> "future-proofing." To me, "free" translates to "loss of
> productivity." I'm not a hobbyist, and I'm not looking to Python as
> something to use "outside of my day job." I make my living with
> tools like this, and have a staff that does as well.

I have to admit that I am still a little unclear what you are looking
to do with Python (other than make money :).  If it's like the little
apps that I get on mostly-audio CDs that play videos at me, then such
is almost certainly possible in Python, though it would take much
longer to write your first few in Python that in Director -- one
assumes macromedia have actually been doing something will all the
dollars you've been heaving at them over the last few years.  But I'd
also be confident that with a bit of experience at it, you could make
a framework that would make it just as easy.

> Please don't interpret any of my comments as saying anything bad about
> list members, contributors, or Python. That isn't the intent at all. I
> do realize that these things take time, that Python is free and
> open-source, and that only I am responsible for my ability to use it,
> and choice to do so.

Conversely, please don't take my response as being too defensive -- it
would be disingenuous to suggest that all is perfect over here in
Python land.  In particular, I'm not aware of any materials for people
arriving at Python from Director/REALbasic, etc.  But there are a lot
of people willing to answer questions, and some pretty damn good stuff
to use already.

Cheers,
mwh

-- 
  Exam invigilation - it doesn't come much harder than that, esp if
  the book you're reading turns out to be worse than expected.
                                  -- Dirk Bruere, sci.physics.research


More information about the Pythonmac-SIG mailing list