Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Aaron Brady
On Nov 16, 4:05 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 16 Nov 2008 07:05:51 +, Arnaud Delobelle wrote: > > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > >> On Sat, 15 Nov 2008 01:40:04 -0800, Rick Giuly wrote: > > >>> Hello All, > > >>> Why is python desig

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Aaron Brady
On Nov 16, 7:28 am, Steve Holden <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Nov 16, 2:05 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: > >>> On Sat, 15 Nov 2008 01:40:04 -0800, Rick Giuly wrote: > Hello All, > Why is pytho

document/image viewer

2008-11-16 Thread belred
does anyone know of any document/image viewers? i would like to create an app that can display (read-only) many types of documents such as .doc, .xls, .tiff, .pdf, etc. it would be great if i can do this using python. looks like i might be able to create something with PIL, but i'm coming up em

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Aaron Brady
On Nov 16, 12:52 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 15 Nov 2008 21:29:22 -0800, Aaron Brady wrote: ... > If you want to be pedantic, then my "answer" (which you seem to approve > of) doesn't correspond to either of the original poster's questions. If > you'r

Re: [Py2exe-users] py2exe 0.6.9 released

2008-11-16 Thread Chris Spencer
After I "compile" my program with py2exe 0.6.9 with Python 2.6, I'm still getting the "Application Did Not Initialize Properly" error dialog whenever I run my code. What am I doing wrong? Note that py2exe 0.6.9 with Python 2.5 works just fine. Help! Chris. On Sat, 15 Nov 2008 23:21:15 -0800,

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Steve Holden
Aaron Brady wrote: > On Nov 16, 7:28 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> George Sakkis wrote: >>> On Nov 16, 2:05 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 15 Nov 2008 01:40:04 -0800, Rick Giuly wrote: >> Hello All,

Re: Generators and their next() and send() methods

2008-11-16 Thread Aaron Brady
On Nov 16, 3:36 pm, Thomas Mlynarczyk <[EMAIL PROTECTED]> wrote: > Arnaud Delobelle schrieb: > > > If you want to simply 'set' the generator (by which I take you mean > > 'change its state') without without iterating it one step, then what you > > need is a class with an __iter__() method.  Then yo

Re: Is this optparse object abuse?

2008-11-16 Thread John O'Hagan
On Sun, 16 Nov 2008, Bruno Desthuilliers wrote: > John O'Hagan a écrit : [...] > > > In other words, using the optparse object to hold as attributes > > everything needed by all the functions and methods in the module, and > > simply passing it holus bolus to all them and just pulling out what's >

Re: C Function Pointer Wrapping Example not working

2008-11-16 Thread Charlie
> > >  But when I try to import test in python, it complains: > >  import _test > >  ImportError: ./_test.so undefined symbol: _Z9binary_opiiPFiiiE > > The above is a mangled name so you've got some C vs C++ problems I'd > say. > > You could try putting some extern "C" {} in around all the functio

Re: Is this optparse object abuse?

2008-11-16 Thread John O'Hagan
On Sun, 16 Nov 2008, Diez B. Roggisch wrote: > John O'Hagan wrote: > > On Sun, 16 Nov 2008, Diez B. Roggisch wrote: > >> > In other words, using the optparse object to hold as attributes > >> > everything needed by all the functions and methods in the module, and > >> > simply passing it holus bolu

Re: Newbie code review of parsing program Please

2008-11-16 Thread Lawrence D'Oliveiro
len wrote: > if fieldline.count('COMP.') > 0: I take it you're only handling a particular subset of COBOL constructs: thus, "COMP" is never "COMPUTATIONAL" or "USAGE IS COMPUTATIONAL", and it always occurs just before the full-stop (can't remember enough COBOL syntax to be sure if anythin

Re: Good practice when writing modules...

2008-11-16 Thread Lawrence D'Oliveiro
Scott David Daniels wrote: > I would amend this advice by adding that you should (in such cases) put > a commented-out import at the top level (so you can look at the top of a > module's source and see what other modules it relies upon. That's what your editor's search function is for. -- http://

Re: Need help in understanding a python code

2008-11-16 Thread alex23
On Nov 17, 11:40 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > That study has been disputed; see the links at the top of > . Now, if there was any independent refutation of the original study that isn't based on Britannica's - not that I'm ou

Re: python script to act as list server

2008-11-16 Thread Lawrence D'Oliveiro
William Gill wrote: > I want to forward any email addressed to [EMAIL PROTECTED] to a python > script that will forward it to all the other subscribers,but does not > reveal the sender's email address. Instead the return address will be > [EMAIL PROTECTED] That way people will be able to have an

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread alex23
On Nov 17, 12:27 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > If multiple statements are needed to perform the > argument initialization, how would you then propose the problem should > be solved? Why, with another function of course! def f(x, y=`f_arg_computation(x)`): ... Or my personal favou

Win 98 with Python 2.5--matplotlib and Numpy problem

2008-11-16 Thread W. eWatson
I'm trying to figure out why an application that both myself and a colleague use gives errors when he uses it under W98. I'm using XP. Py 2.5 is installed on each of our machines. His first problem came with matplotlib that pointed to the "from pylab ..." line below. The message ended with " .

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Terry Reedy
Steven D'Aprano wrote: Because of Python's interpreted nature, names can't be compiled away as in C, they need a concrete runtime existence, but does the language definition need to assume that? Of course. It wouldn't be Python if they didn't. However, remember that objects don't have names.

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread rurpy
On Nov 16, 5:12 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> The Python Reference Manual states that an object >> consists of identity, type, and value. "Identity" >> seems to be non-controversial. >> >> Let's take "type" as meaning the attributes an >> object inherits from it's class. "value"

end child process when parent dies (on Unix)

2008-11-16 Thread Дамјан Георгиевски
Hi all, I'm starting a Unix tool with subprocess.Popen() from a python script and I want the child to be killed when the parent (my script) ends for whatever reason *including* if it gets killed by SIGKILL. For normal situations I can send a signal to the pid of the Popen object. But not if the

Re: py2exe 0.6.9 released

2008-11-16 Thread Benjamin Kaplan
On Sun, Nov 16, 2008 at 2:21 AM, Jimmy Retzlaff <[EMAIL PROTECTED]> wrote: > py2exe 0.6.9 released > = > > py2exe is a Python distutils extension which converts Python scripts > into executable Windows programs, able to run without requiring a > Python installation. Console and

Re: Single-instance daemons

2008-11-16 Thread Дамјан Георгиевски
> As per Stevens/Rago, "file and record locking provides a convenient > mutual-exclusion mechanism". On linux (at least) there's one nice trick to get a single-instance program. Create a unix domain socket, and bind it to an address that begins with the null character '\0'. You can bind the sa

RE: [Py2exe-users] py2exe 0.6.9 released

2008-11-16 Thread Mark Hammond
> After I "compile" my program with py2exe 0.6.9 with Python 2.6, I'm > still getting the "Application Did Not Initialize Properly" error > dialog whenever I run my code. What am I doing wrong? This probably means the Microsoft VC90 binaries aren't installed globally on your machine - which would

Python and Its Libraries--Who's on First?

2008-11-16 Thread W. eWatson
Is there some repository that says something like for Python 2.5 it works with: Win OSes: W2K, XP, Vista numpy vers y, matplotlib vers x. scipy z, etc. -- W. eWatson (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15'

PP3E error

2008-11-16 Thread ryan payton
I still need help with a PP3E error I am getting in my 'PyEdit' program I have from Progamming Python 3rd Edition. I am working on a mac and the error is coming from: from PP3E.Gui.Tools.guimaker import * -- http://mail.python.org/mailman/listinfo/python-list

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-16 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Or one could adopt what Terry Reedy called a 4-aspect view: an object is identity, class, value (or local-state or something) and intrinsic-value. What I specifically said is id, class, instance attributes, and private data. So objects have only one, some only the ot

Re: document/image viewer

2008-11-16 Thread Lawrence D'Oliveiro
belred wrote: > does anyone know of any document/image viewers? Okular. -- http://mail.python.org/mailman/listinfo/python-list

Re: end child process when parent dies (on Unix)

2008-11-16 Thread Lawrence D'Oliveiro
Дамјан Георгиевски wrote: > I'm starting a Unix tool with subprocess.Popen() from a python script > and I want the child to be killed when the parent (my script) ends for > whatever reason *including* if it gets killed by SIGKILL. A Linux-specific solution is prctl(2). -- http://mail.python.org/m

Re: Customizing sequence types

2008-11-16 Thread Terry Reedy
Mr.SpOOn wrote: On Sun, Nov 16, 2008 at 7:15 PM, Arnaud Delobelle You should probably use the `bisect` module (http://docs.python.org/library/bisect.html) for searching and inserting into the list as it takes advantage of and ensures that the list keeps sorted. It also means that __contains__

Re: PP3E error

2008-11-16 Thread Gabriel Genellina
En Mon, 17 Nov 2008 03:32:35 -0200, ryan payton <[EMAIL PROTECTED]> escribió: I still need help with a PP3E error I am getting in my 'PyEdit' program I have from Progamming Python 3rd Edition. I am working on a mac and the error is coming from: from PP3E.Gui.Tools.guimaker import * Please

Re: Win 98 with Python 2.5--matplotlib and Numpy problem

2008-11-16 Thread Tino Wildenhain
W. eWatson wrote: I'm trying to figure out why an application that both myself and a colleague use gives errors when he uses it under W98. I'm using XP. Py 2.5 is installed on each of our machines. His first problem came with ... Clearly things have gone astray. Is numpy somehow not compati

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Chris Rebert
For the Nth time this year that this has come up, I'll point out yet again that this issue has already been discussed to death before: [Python-ideas] proto-PEP: Fixing Non-constant Default Arguments http://mail.python.org/pipermail/python-ideas/2007-January/000121.html [Python-3000] pre-PEP: Defa

Re: special editor support for indentation needed.

2008-11-16 Thread John Yeung
On Nov 15, 8:50 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > well, therein lies the rub.  I don't know lisp, > I don't know Emacs internals let alone python mode. Unfortunately, neither do I. Actually, I haven't touched Emacs since my college days, and barely remember any of it. I figure

Looking for Advice: Creation vs Access in OO Models

2008-11-16 Thread Rafe
Hi, I'm going to try and keep this as general as possible. I'm building an object model/API for creating and working with 'things' (I'm actually working with a 3D application through COM, so I guess I'm making a kind of middleware or wrapper interface). I'm looking for some advice on structure and

Re: inspect.findsource problem with llinecache

2008-11-16 Thread Rafe
On Nov 15, 1:29 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 12 Nov 2008 05:22:55 -0200,Rafe<[EMAIL PROTECTED]> escribió: > > > I think I have discovered two bugs with the inspect module and I would > > like to know if anyone can spot any traps in my workaround. > > They look like r

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Aaron Brady
On Nov 16, 8:16 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 16, 12:52 am, Steven D'Aprano <[EMAIL PROTECTED] > > I've given practical reasons why the > > Python choice is better. If you want default argument to be created from > > scratch when the function is called, you can get it with lit

Re: special editor support for indentation needed.

2008-11-16 Thread Jeremiah Dodds
On Mon, Nov 17, 2008 at 1:36 AM, John Yeung <[EMAIL PROTECTED]>wrote: > On Nov 15, 8:50 pm, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > > well, therein lies the rub. I don't know lisp, > > I don't know Emacs internals let alone python mode. > > Is vr-mode a "major" mode? If so, I suppose it

Re: Official definition of call-by-value (Re: Finding the instancereference...)

2008-11-16 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > There's also the question, if you say that an object is different from > its value, of determining what the value's value is ... This one is easy - its obviously the value that is returned when the value is returned when you call for the value that you

Re: Optional parameter object re-used when instantiating multiple objects

2008-11-16 Thread Aaron Brady
On Nov 17, 12:52 am, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 16, 8:16 pm, Aaron Brady <[EMAIL PROTECTED]> wrote: > > On Nov 16, 12:52 am, Steven D'Aprano <[EMAIL PROTECTED] > > > I've given practical reasons why the > > > Python choice is better. If you want default argument to be created f

<    1   2