Re: Augument assignment versus regular assignment

2006-07-20 Thread Terry Reedy
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-07-19, Terry Reedy <[EMAIL PROTECTED]> wrote: >> >> But I won't. The amount of duplication that can be factored out with >> augmented assignment depends on the granularity of operations. > > I can agree with th

Re: ImportError: libclntsh.so.10.1: cannot open shared object file: Permission denied

2006-07-20 Thread Bill Scherer
gmax2006 wrote: >Hi, > >I am using RedHat Linux 4. and I developed an oracle 10g based >application by using cx_Oracle (cx_Oracle-4.1-10g-py23-1.i386.rpm) and >Python 2.3.4. > >When I run the application through direct console connection, It works >perfect. > >But, when I schedule a crontab job to

Re: ConfigParser: what read('non-existent-filename') returns in 2.3.x?

2006-07-20 Thread Chris Lambacher
On Thu, Jul 20, 2006 at 10:50:40AM -0700, Danil Dotsenko wrote: > Wrote a little "user-friedly" wrapper for ConfigParser for a KDE's > SuperKaramba widget. > (http://www.kde-look.org/content/show.php?content=32185) > > I was using 2.4.x python docs as reference and > ConfigParser.read('non-existen

IronPython and scipy/pyExcelerator

2006-07-20 Thread tkpmep
I'm looking forward to the release IronPython, primarily for its IDE. I currently use scipy and pyExcelerator to crunch numbers and write them to Excel: does can these packages be used with IronPython as well? Thanks in advance Thomas Philips -- http://mail.python.org/mailman/listinfo/python-li

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Ed Jensen
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> Java is not an acronym. That is: it's "Java", not "JAVA". > > Now THAT was an important information RIGHT on topic. It was not meant offensively. >> Java does not allow access to private members via reflection. > > For somebody nitpicking on natur

Re: ImportError: libclntsh.so.10.1: cannot open shared object file: Permission denied

2006-07-20 Thread Damjan
> I am using RedHat Linux 4. and I developed an oracle 10g based > application by using cx_Oracle (cx_Oracle-4.1-10g-py23-1.i386.rpm) and > Python 2.3.4. > > When I run the application through direct console connection, It works > perfect. > > But, when I schedule a crontab job to run the applica

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : >> You mean: >> >> class Pythonic(object): >> def __init__(self): >> self._is_active = True >> >> @apply >> def is_active(): >> def fget(self): return self._is_active >> def fset(self): raise SomeException('sorry, read-only') >> return

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
Gerhard Fiedler a écrit : > On 2006-07-20 09:40:31, Bruno Desthuilliers wrote: > > >>>I'm not sure, but there's one thing that has a potential to be the real >>>issue: what's the common way to create a property that is read-write >>>for the implementation and "read-only" for the interface? >> >>

Re: question about what lamda does

2006-07-20 Thread danielx
Bruno Desthuilliers wrote: > danielx wrote: > (snip) > > > Python's lambda really can't be as powerful as Lisp's because Python > > does not have expressions that do case analysis (this is not lambda's > > fault, of course ;). The reason is that you really want to put each > > case on its own set

Re: using names before they're defined

2006-07-20 Thread Larry Bates
I don't know if you saw my earlier post but something like this has worked for me. What about something like: supply = supply() compressor = compressor(supply) combuster1= combuster(compressor) combuster2= combuster(compressor) compressor.append(combuster1) compressor.append(combuster2) or perha

Re: ConfigParser: what read('non-existent-filename') returns in 2.3.x?

2006-07-20 Thread Danil Dotsenko
Chris Lambacher wrote: > On Thu, Jul 20, 2006 at 10:50:40AM -0700, Danil Dotsenko wrote: >> Wrote a little "user-friedly" wrapper for ConfigParser for a KDE's >> SuperKaramba widget. >> (http://www.kde-look.org/content/show.php?content=32185) >> >> I was using 2.4.x python docs as reference and >>

Re: function v. method

2006-07-20 Thread danielx
Bruno Desthuilliers wrote: > danielx wrote: > > Bruno Desthuilliers wrote: > > > >>danielx wrote: > > (snip) > >>>which gets me thinking again about > >>>the stuff I self-censored. Since the dot syntax does something special > >>>and unexpected in my case, > >> > >>"unexpected" ? Did you ever wond

Re: Py2exe & (Py)QT4

2006-07-20 Thread David Boddie
[EMAIL PROTECTED] wrote: > I'm having trouble using Py2exe with a PyQT-based python project. Or > possibly I'm having a problem with PyQT and Py2exe makes it apparent. > Whichever it is, I run into trouble with importing QtCore and QtGui. > The error reported is: > > Traceback (most recent call la

Problem with cx_freeze / FreezePython

2006-07-20 Thread Kevin Walzer
I am trying to build a simple "hello.py" script with cx_freeze, but am not having any luck. Every time I run the FreezePython utility I get this error message: Traceback (most recent call last): File "/Users/kevin/Desktop/cx_Freeze-3.0.2/initscripts/ConsoleKeepPath.py", line 15, in ? exec co

Re: [OT] Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : > On Thu, 20 Jul 2006 12:52:52 +0200, Bruno Desthuilliers > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>Granted. Actually, it *was* a typo - but it happened to also make sens, >>so I decided it was not a typo !-) >> > > Ah... One of th

Re: ConfigParser: what read('non-existent-filename') returns in 2.3.x?

2006-07-20 Thread Danil Dotsenko
Danil Dotsenko wrote: > Chris Lambacher wrote: >> On Thu, Jul 20, 2006 at 10:50:40AM -0700, Danil Dotsenko wrote: >>> Wrote a little "user-friedly" wrapper for ConfigParser for a KDE's >>> SuperKaramba widget. >>> (http://www.kde-look.org/content/show.php?content=32185) >>> >>> I was using 2.4.x

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Bruno Desthuilliers
Ant a écrit : > Came across this article this afternoon - thought it may be of interest > to some of those following this thread... > > http://www.devx.com/opensource/Article/31593/0/page/2 > Yeah. Presenting name mangling as the usual way to have 'private' attributes, then implementing (costly)

Re: using names before they're defined

2006-07-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hiya > > Could you just talk me through this... is it: > > >>schema = {'turbine1': {'class': 'Turbine', >> 'upstream' : ('frobnicator2',), >> 'downstream' : () # nothing, >> }, >> 'frobnicato

RE: Bug? Certainly a new *behavior* from subprocess in 2.5 on Win32

2006-07-20 Thread Delaney, Timothy (Tim)
Larry Hastings wrote: > Under Python 2.5, both beta 1 and beta 2, it dumps the results to the > command shell, but *also* prints this: > > Exception exceptions.AttributeError: "'NoneType' object has no > attribute 'append'" in > ignored Could you raise this as a bug on Sourceforge? Cheers, Ti

Re: Bug? Certainly a new *behavior* from subprocess in 2.5 on Win32

2006-07-20 Thread Larry Hastings
Delaney, Timothy (Tim) wrote: > Could you raise this as a bug on Sourceforge? Done; it is "request ID" 1526203. https://sourceforge.net/tracker/index.php?func=detail&aid=1526203&group_id=5470&atid=105470 Cheers, /larry/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python code from Java?

2006-07-20 Thread Ray
fortepianissimo wrote: > > Waiting for jython2.3 might be an option, too - things are pretty much > > on the move right now. > > Any idea how soon that will be? If you just want to use Java to call Python, you can use Jython 2.1 too. Jython 2.2 is in (active) development right now, and hopefully a

Re: Accessors in Python (getters and setters)

2006-07-20 Thread fuzzylollipop
Ed Jensen wrote: > Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > Ah, you mean like in JAVA > > Java is not an acronym. That is: it's "Java", not "JAVA". > > > where the compiler prevents you from accessing > > private variables, but the runtime allows access to these very variables > > via refl

Re: function v. method

2006-07-20 Thread fuzzylollipop
danielx wrote: > Bruno Desthuilliers wrote: > > danielx wrote: > > > At first I was going to post the following: > > > > > > > > > > > (snip) > > > > > > > > > > > > but then I tried this: > > > > > > > > res = Foo.__dict__['func'] > > res is dan > > > > > > True > > > > > > And it all s

Since there was talk of if-then-else not being allowed in lambda expressions, the following is from "Dive into Python"

2006-07-20 Thread Casey Hawthorne
Since there was talk of if-then-else not being allowed in lambda expressions, the following is from "Dive into Python" The and-or conditional expression trick from page 41 of "Dive into Python" Wrap the arguments in lists and then take the first element. >>> a = "" >>> b = "second" >>> (1 and [a

change default install directory when using bdist_rpm

2006-07-20 Thread krithika . sridhar
Hi, I'm using : python setup.py bdist_rpm to create an rpm package to distribute my python app on linux. When i install the rpm, the files are installed in /usr/share/python/site-packages/. directory by default. How do i change the installation directory?? Thanks, krithika -- http://mail

Re: Note on PEP 299

2006-07-20 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I don't like much the syntax of: > if __name__ == '__main__': > > Some time ago I have read this PEP: > http://www.python.org/dev/peps/pep-0299/ > > And why it was refused: > http://mail.python.org/pipermail/python-dev/2006-March/062955

How to use pdb?

2006-07-20 Thread tron . thomas
I am trying to figure out how to use the pdb module to debug Python programs, and I'm having difficulties. I am pretty familiar with GDB which seems to be similar, however I cannot even get the Python debugger to break into a program so I can step through it. I wrote a simple program and below is

Re: compiling 2.3.5 on ubuntu

2006-07-20 Thread Anthony Baxter
On 7/17/06, Py PY <[EMAIL PROTECTED]> wrote: Sorry to be a pest but is there anybody that could help me understanda) if any of this is a problem; and b) where I can learn how to fix it. sudo apt-get build-dep python2.3 then rebuild. -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking File permissions

2006-07-20 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Anoop wrote: > Please tell me how to check the existence of a file and the read > permission to the file using python script Without knowing what your precise needs are, the best way is to open the file and try to read from it. If that succeeds, then you've got rea

Re: function v. method

2006-07-20 Thread Alex Martelli
danielx <[EMAIL PROTECTED]> wrote: > > ...and source code... > > *shudders* What happened to all the goodness of abstraction? Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Since there was talk of if-then-else not being allowed in lambda expressions, the following is from "Dive into Python"

2006-07-20 Thread Peter Otten
Casey Hawthorne wrote: > Since there was talk of if-then-else not being allowed in lambda > expressions, the following is from "Dive into Python" > > The and-or conditional expression trick from page 41 of "Dive into > Python" > > Wrap the arguments in lists and then take the first element. > >

<    1   2