Re: Combinatorial of elements in Python?

2007-08-15 Thread Sean Tierney
Hi Team,

I'm trying to get Python hooked up to MySQL using MySQL-python-1.2.2

Details:
Mac OS X 10.4.x
Python2.5
MySQL 5.x.x
MySQL-python-1.2.2
gcc

Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5250.obj~12/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0
--build=powerpc-apple-darwin8 --with-arch=pentium-m
--with-tune=prescott --program-prefix= --host=i686-apple-darwin8
--target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5250)

When I run $ python setup.py build, I get this message:

~/Desktop/MySQL-python-1.2.2 SeanThomas$ python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0)
-D__version__=1.2.2
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
-c _mysql.c -o build/temp.macosx-10.3-fat-2.5/_mysql.o
_mysql.c:35:23: error: my_config.h: No such file or directory
_mysql.c:41: error: parse error before string constant
_mysql.c:78: error: parse error before 'MYSQL'
_mysql.c:78: warning: no semicolon at end of struct or union
_mysql.c:81: error: parse error before '}' token
_mysql.c:81: warning: data definition has no type or storage class
_mysql.c:92: error: parse error before 'MYSQL_RES'
_mysql.c:92: warning: no semicolon at end of struct or union
_mysql.c:96: error: parse error before '}' token
_mysql.c:96: warning: data definition has no type or storage class
_mysql.c:108: error: parse error before '*' token
_mysql.c: In function '_mysql_Exception':
_mysql.c:122: error: 'c' undeclared (first use in this function)
_mysql.c:122: error: (Each undeclared identifier is reported only once
_mysql.c:122: error: for each function it appears in.)
_mysql.c:125: error: 'CR_MAX_ERROR' undeclared (first use in this function)
_mysql.c:133: error: 'CR_COMMANDS_OUT_OF_SYNC' undeclared (first use
in this function)

~100+ or more lines of error message then it ends with:

lipo: can't figure out the architecture type of: /var/tmp//cc1VlbOG.out
error: command 'gcc' failed with exit status 1


Can someone point me in the right direction?

Thanks, and Happy Wednesday.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zope review

2007-09-21 Thread Sean Tierney
It might help if someone could contrast Zope w/ another Python
framework like Twisted.

I've been investing some time in learning Zope/Plone and would love to
hear someone speak to alternatives.

"part of the brain"  -- would that speak to the "event-based" approach
of Twisted?  The "event-based" approach is mentioned by John Goerzen
in "Foundations of Python Network Programming" (Apress).

Happy Times.


On 9/21/07, Istvan Albert <[EMAIL PROTECTED]> wrote:
> On Sep 20, 7:44 pm, Norm <[EMAIL PROTECTED]> wrote:
>
> > without meaning to start a flame war between the various python web
> > tools, I was wondering if anyone had a review of the status of Zope.
> > For example, is it being used for new projects or just maintenance?
>
> Zope is heavily used. It is a mature and reliable product. It is also
> very complicated and requires (enforces) a particular way of
> programming that can feel very burdensome if it does not 'fit your
> brain'.
>
> i.
>
>
>
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Sean Tierney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-21 Thread Sean Tierney
Just tell him that "functions are like all  other variables and can
therefore be passed by other functions or returned by other functions.
"

If your friend understands variables and functions and he can't make
the "leap" (and assuming you're right, of course) then your friend
doesn't understand variables and functions.

Happy Friday.

Sean

On 9/21/07, Cristian <[EMAIL PROTECTED]> wrote:
> On Sep 21, 3:44 pm, Ron Adam <[EMAIL PROTECTED]> wrote:
>
> > I think key may be to discuss names and name binding with your friend.  How
> > a name is not the object it self, like a variable is in other languages.
> > For example show him how an object can have more than one name.  And discus
> > how names can be bound to nearly anything, including classes and functions.
>
> I could discuss name binding but it would be great if Python said this
> itself. After all, you can even bind a module with the foo = bar
> syntax by using __import__ function. If function definitions followed
> the same pattern, I think a beginner would subconsciously (maybe even
> consciously) realize that function names are just like everything
> else. Actually, this would be helpful for many people. If you come
> from a language like Java you're used to thinking of attributes and
> methods as living in different namespaces. I think a new syntax will
> encourage seasoned programmers think in a more Pythonic way.
>
> Python has done a very good job in easing people into programming. My
> friend doesn't come to me very often because the syntax is clear and
> simple and the builtin datatypes allow you to do so much. My goal is
> that I would never have to explain to him about name binding; that
> he'd pick it up by learning the language on his own. He's learned
> lists, dictionaries and even some OOP without me. I don't think name
> binding would be a stretch.
>
> > You could also discus factory functions with him.  Once he gets that a
> > function can return another function, then it won't be so much of a leap
> > for a function to take a function as an argument.
>
> I think this isn't the most intuitive way of approaching first order
> functions. It's true that if a function can return another function
> then a function must be first order (i.e., it's just like any other
> variable), but that seems almost backwards to me. I think it would
> make more sense to have beginners _know_ that functions are like all

> other variables and can therefore be passed by other functions or
> returned by other functions. That I think would be better accomplished
> if they define functions the same way you would define other variables
> that you know can be passed and returned.
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Sean Tierney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Would Anonymous Functions Help in Learning Programming/Python?

2007-09-21 Thread Sean Tierney
On 9/21/07, Sean Tierney <[EMAIL PROTECTED]> wrote:
> Just tell him that "functions are like all  other variables and can
> therefore be passed by other functions or returned by other functions.
> "
>
> If your friend understands variables and functions and he can't make
> the "leap" (and assuming you're right, of course) then your friend
> doesn't [might not] understand variables and functions [and he might need 
> patience b/c this stuff is hard and not everyone is as smart as everyone 
> else].
>
> Happy Friday.
>
> Sean [moderately overweight, self-admitted (very) slow learner.]
>
> On 9/21/07, Cristian <[EMAIL PROTECTED]> wrote:
> > On Sep 21, 3:44 pm, Ron Adam <[EMAIL PROTECTED]> wrote:
> >
> > > I think key may be to discuss names and name binding with your friend.  
> > > How
> > > a name is not the object it self, like a variable is in other languages.
> > > For example show him how an object can have more than one name.  And 
> > > discus
> > > how names can be bound to nearly anything, including classes and 
> > > functions.
> >
> > I could discuss name binding but it would be great if Python said this
> > itself. After all, you can even bind a module with the foo = bar
> > syntax by using __import__ function. If function definitions followed
> > the same pattern, I think a beginner would subconsciously (maybe even
> > consciously) realize that function names are just like everything
> > else. Actually, this would be helpful for many people. If you come
> > from a language like Java you're used to thinking of attributes and
> > methods as living in different namespaces. I think a new syntax will
> > encourage seasoned programmers think in a more Pythonic way.
> >
> > Python has done a very good job in easing people into programming. My
> > friend doesn't come to me very often because the syntax is clear and
> > simple and the builtin datatypes allow you to do so much. My goal is
> > that I would never have to explain to him about name binding; that
> > he'd pick it up by learning the language on his own. He's learned
> > lists, dictionaries and even some OOP without me. I don't think name
> > binding would be a stretch.
> >
> > > You could also discus factory functions with him.  Once he gets that a
> > > function can return another function, then it won't be so much of a leap
> > > for a function to take a function as an argument.
> >
> > I think this isn't the most intuitive way of approaching first order
> > functions. It's true that if a function can return another function
> > then a function must be first order (i.e., it's just like any other
> > variable), but that seems almost backwards to me. I think it would
> > make more sense to have beginners _know_ that functions are like all
>
> > other variables and can therefore be passed by other functions or
> > returned by other functions. That I think would be better accomplished
> > if they define functions the same way you would define other variables
> > that you know can be passed and returned.
> >
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
>
> --
> Sean Tierney
>


-- 
Sean Tierney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Zope review

2007-09-22 Thread Sean Tierney
>From Twisted's website "Twisted is a networking engine written in
Python, supporting numerous protocols. It contains a web server,
numerous chat clients, chat servers, mail servers, and more.

Given that Zope is also a written in python, supports numerous
protocols, contains a webserver, has several chat packages available,
a comparison/contrast would be quite useful.

I will try to amass some info and bring it back here by midweek.

Thanks,

Sean

On 9/21/07, Istvan Albert <[EMAIL PROTECTED]> wrote:
> On Sep 21, 7:04 pm, "Sean Tierney" <[EMAIL PROTECTED]> wrote:
>
> > someone could contrast Zope w/ another Python framework like Twisted.
>
> > I've been investing some time in learning Zope/Plone and would love to
> > hear someone speak to alternatives.
>
> Twisted is a networking engine, Zope is a web application framework,
> Plone is a content management system, there is nothing to compare,
> these are different applications altogether, it is not like you'd
> replace one with the other
>
> For applications that can be compared see Zope vs Django vs Pylons vs
> web.py vs CherryPy. Google these and contrast away.
>
> i
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-- 
Sean Tierney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: your opinion on book "Foundations of Python Network Programming"?

2007-09-28 Thread sean tierney
I just read it (though I bought it half a year ago...don't judge :).

Author recommends Python 2.3 and above...and as far as I know the
examples are good.  And if anything IS outdated -- you'll be able to
do some quick research to get you to where you need to be...and he
does mention code several areas of change/addition/modification. (ie
urllib and urllib2).  He uses a couple of 3rd party projects too.

I really liked the book.  I think Goerzen did a good job.  He
addresses the code in the context of the problem the code is meant to
solve, which I found helpful.  That said, it's not a substitute for
actually reading the code.

...if you haven't read the most recent edition of Programming Python
by Mark Lutz (O'Reilly), I'd recommend that first.  Programming Python
covers (some) networking and everything else.  More bang for the $$.



Sean



On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hello,
>
> i'm debating if i should buy this book. it received good reviews at
> Amazon: http://tinyurl.com/24zvrf. but it was published in 2004 and
> i'm afraid quite some materials might be outdated? any input?
>
> thanks,
>
> kelie
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-- 
http://mail.python.org/mailman/listinfo/python-list