Re: Error in optparse documentation

2007-05-27 Thread John Machin
On May 28, 7:54 am, Shatadal <[EMAIL PROTECTED]> wrote: > In the python documentation section 14.3.2.6 (http://docs.python.org/ > lib/optparse-generating-help.html) in the last line it is written > > "options that have a default value can include %default in the help > string--optparse will replace

Re: unit testing

2007-05-27 Thread Steven Bethard
Steve Howell wrote: > --- Steven Bethard <[EMAIL PROTECTED]> wrote: >> Have you tried py.test? >> >> http://codespeak.net/py/dist/test.html >> >> I've heard good things about it, but haven't gotten >> around to trying it >> yet. Here's a two-line test suite from the page >> above: >> >>

Re: What's the best way to iniatilize a function

2007-05-27 Thread Steven D'Aprano
On Sun, 27 May 2007 10:51:46 -0700, Jack wrote: > I have a set of functions to wrap a library. For example, > > mylib_init() > mylib_func() > mylib_exit() > > or > > handle = mylib_init() > mylib_func(handle) > mylib_exit(handle) > > In order to call mylib_func(), mylib_init() has to be called

Re: unit testing

2007-05-27 Thread Steve Howell
Let me preface every reply here by YMMV. I strongly, strongly encourage people to tap into the unit testing community for all tools that are available to them. Also, let me say that despite any place where Steven and I disagree about the mechanics of unit testing, we're in firm agreement that UNI

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-27 Thread Ben Finney
Paul McGuire <[EMAIL PROTECTED]> writes: > It is a bit reassuring that I am not the only one who turns a blind > eye to this part of the PEP, that l_c_w_u bothers others as well. I see similar support for lower_case, and opposition to camelCase. It's nice that we're both reassured by what we see.

CGI + appscript newbie question/problem

2007-05-27 Thread Andres Francisco Rojas
Hey everyone. So I'm more or less new to Python, just wanted to say that right up front so please excuse any silly questions. Generally what I'm trying to do is control a Mac OS X application through a website via Python and appscript. I have successfully got Apache running and configured to run

Re: itertools.groupby

2007-05-27 Thread Carsten Haese
On Sun, 2007-05-27 at 14:59 -0700, Steve Howell wrote: > Huh? How is code that uses itertools.groupby not an > actual example of using itertools.groupby? Here's how: """ The returned group is itself an iterator that shares the underlying iterable with groupby(). Because the source is shared, whe

Re: Why isn't this query working in python?

2007-05-27 Thread Carsten Haese
On Sun, 2007-05-27 at 16:39 -0400, [EMAIL PROTECTED] wrote: > > sql = """SELECT payment_id FROM amember_payments WHERE > > member_id=%s AND expire_date > NOW() AND completed=1 AND (product_id > >>> 11 AND product_id <21)""", (self.uid) > > > > > And doesn't the above comma, need to b

Re: itertools.groupby

2007-05-27 Thread Raymond Hettinger
On May 27, 2:59 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > These docs need work. Please do not defend them; > please suggest improvements. FWIW, I wrote those docs. Suggested improvements are welcome; however, I think they already meet a somewhat high standard of quality: - there is an accur

Re: itertools.groupby

2007-05-27 Thread Steve Howell
--- Carsten Haese <[EMAIL PROTECTED]> wrote: > [...] It's an abstract code pattern for an abstract use > case. I question the use of abstract code patterns in documentation, as they just lead to confusion. I really think concrete examples are better in any circumstance. Also, to the OP's ori

RE: Xml parser

2007-05-27 Thread Eiwot
Let's try http://pyxml.sourceforge.net/ Cheers Python Articles at http://pyarticles.blogspot.com/> Date: Sat, 26 May 2007 10:02:06 +0200> From: [EMAIL PROTECTED]> Subject: Re: Xml parser> To: python-list@python.org> > XiaQ wrote:> > You can use DOM> > http://diveintopython.org/, Chapter 9> > "a

Re: itertools.groupby

2007-05-27 Thread Steve Howell
--- Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > FWIW, I wrote those docs. Suggested improvements > are > welcome; however, I think they already meet a > somewhat > high standard of quality: > I respectfully disagree, and I have suggested improvements in this thread. Without even reading

os.path.walk not pruning descent tree (and I'm not happy with that behavior?)

2007-05-27 Thread Joe Ardent
Good day, everybody! From what I can tell from the archives, this is everyone's favorite method from the standard lib, and everyone loves answering questions about it. Right? :) Anyway, my question regards the way that the visit callback modifies the names list. Basically, my simple example is:

Re: python -- prolog bridge error

2007-05-27 Thread yuce
Hello, PySWIP requires "libpl.dll" to be on the path. There are two ways to do this: 1) Add 'bin' directory of SWI-Prolog to the PATH (it's C:\Program Files \pl\bin on my system), 2) Or, copy 'libpl.dll' and 'pthreadVC.dll' to C:\WINDOWS\system32 That should solve the problem, happy hacking :)

Unsubscribing from the mailing list

2007-05-27 Thread [EMAIL PROTECTED]
Hi All, I do not know if this is the correct group to ask this question. But since mailman is python-based I thought i would ask here. I had subscribed to a mailing list called [EMAIL PROTECTED] adventitiously. I then wanted to reverse my decision and so tried to unsubscribe from the mailing list

Re: Why isn't this query working in python?

2007-05-27 Thread Steve Holden
[EMAIL PROTECTED] wrote: > > On May 27, 2007, at 4:01 PM, Steve Holden wrote: > >> erikcw wrote: >>> On May 26, 8:21 pm, John Machin <[EMAIL PROTECTED]> wrote: On May 27, 5:25 am, erikcw <[EMAIL PROTECTED]> wrote: > On May 25, 11:28 am, Carsten Haese <[EMAIL PROTECTED]> wr

Re: itertools.groupby

2007-05-27 Thread Paul Rubin
Raymond Hettinger <[EMAIL PROTECTED]> writes: > The groupby itertool came-out in Py2.4 and has had remarkable > success (people seem to get what it does and like using it, and > there have been no bug reports or reports of usability problems). > All in all, that ain't bad (for what 7stud calls a po

Re: Newbie question - better way to do this?

2007-05-27 Thread Paul Rubin
Eric <[EMAIL PROTECTED]> writes: > words is a big long array of strings. What I want to do is find > consecutive sequences of words that have the first letter capitalized, > and then call doSomething on them. (And you can ignore the fact that > it won't find a sequence at the very end of words, t

Re: PHP5 programmer learning Python

2007-05-27 Thread Luis M . González
On May 27, 12:41 pm, romiro <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm a PHP5 developer looking to "broaden my horizons" so to speak by > learning a new language. I emphasize the 5 in PHP since I have fully > engrossed myself in the full OOP of version 5 with my own ground-up > projects as well a

Re: os.path.walk not pruning descent tree (and I'm not happy with that behavior?)

2007-05-27 Thread Peter Otten
Joe Ardent wrote: > Good day, everybody! From what I can tell from the archives, this is > everyone's favorite method from the standard lib, and everyone loves > answering questions about it. Right? :) I don't know what to make of the smiley, so I'll be explicit: use os.walk() instead of os.pat

Re: ten small Python programs

2007-05-27 Thread DJ Fadereu
> > You could try this wiki page: > > http://rosettacode.org/wiki/Main_Page > > It has a fair amount of Python examples as well as many more other > languages (doing the same algorithm). > > Hope this helps. > > Adonis THIS IS GREAT :) Thanx! -- http://mail.python.org/mailman/listinfo/python-l

Re: itertools.groupby

2007-05-27 Thread Raymond Hettinger
On May 27, 8:28 pm, Paul Rubin wrote: > I use the module all the time now and it is great. Thanks for the accolades and the great example. FWIW, I checked in a minor update to the docs: +++ python/trunk/Doc/lib/libitertools.tex Mon May 28 07:23:22 2007 @@ -138,6 +13

Re: os.path.walk not pruning descent tree (and I'm not happy with that behavior?)

2007-05-27 Thread Gabriel Genellina
En Sun, 27 May 2007 22:39:32 -0300, Joe Ardent <[EMAIL PROTECTED]> escribió: > Good day, everybody! From what I can tell from the archives, this is > everyone's favorite method from the standard lib, and everyone loves > answering questions about it. Right? :) Well, in fact, the preferred (and

Re: Help with PySMS

2007-05-27 Thread DJ Fadereu
On May 28, 1:53 am, Petr Jakes <[EMAIL PROTECTED]> wrote: > Maybe you can try python binding for gammu, which works great for me. > HTH > Petr Jakes > > http://cihar.com/gammu/python/ I'm going to try and setup Gammu today. I'm using a DKU-2 cable connection. The Gammu guide says that:"Before you

gui application on cross platform

2007-05-27 Thread james_027
Hi, I am using delphi to develop gui application, and wish to make a shift to python. here are some of my question/concern... 1. is python develop gui application a cross platform? just like java swing? 2. delphi makes things easy for me like coding for a specific event on a specific component, c

Re: What's the best way to iniatilize a function

2007-05-27 Thread Jack
Thanks Steven, for the reply. Very helpful. I've got a lot to learn in Python :) Some questions: > (1) Python can automatically free most data structures and close open > files, but if your needs are more sophisticated, this approach may not be > suitable. Since it's a wrapper of a DLL or .so f

Re: itertools.groupby

2007-05-27 Thread Paul Rubin
Raymond Hettinger <[EMAIL PROTECTED]> writes: > On May 27, 8:28 pm, Paul Rubin wrote: > > I use the module all the time now and it is great. > Thanks for the accolades and the great example. Thank YOU for the great module ;). Feel free to use the example in the docs i

<    1   2