Re: What's the difference ?

2007-08-29 Thread Alexandre Badez
Thanks for all you information. I'll continue to use 'in' instead of 'has_key' for a "faster, more concise, & readable" code (^L^ ) -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting a read-only attribute

2007-08-31 Thread Alexandre Badez
On Aug 30, 11:35 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have an object and wish to set an attribute on it which, > unfortunately for me, is read-only. > > How can I go about this? > > Cheers. > -T Could you show the object you want to set his attribute? Until that, it's difficult

Multi Heritage with slots

2007-09-05 Thread Alexandre Badez
Hye, I'm developing a little app, and I want to make multi heritage. My problem is that my both parent do have __slots__ define. So I've got something like: class foo(object): __slots__ = ['a', 'b'] pass class foo2(object): __slots__ = ['c', 'd'] pass class crash(foo, foo2):

Re: Multi Heritage with slots

2007-09-05 Thread Alexandre Badez
On Sep 5, 12:42 pm, "Eric Brunel" <[EMAIL PROTECTED]> wrote: > Seehttp://mail.python.org/pipermail/python-list/2006-December/418768.html > > Basically, the general advice you're likely to get here is: don't use > __slots__, or at least don't use __slots__ with inheritance. > > BTW, what are you try

Re: Multi Heritage with slots

2007-09-05 Thread Alexandre Badez
On Sep 5, 2:56 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Sep 5, 2:52 pm, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > > > On 9/5/07, Alexandre Badez <[EMAIL PROTECTED]> wrote: > > > > I use __slots__ not for memory optimization no

Raw string printing

2007-09-25 Thread Alexandre Badez
Hy ! I would like to do something like: s = r"a\tb\n" print s # result with a\tb\n print unraw(s) # <= this is the "magic" function I'm searching for # result with ab n Does any of you know how to do it properly ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw string printing

2007-09-25 Thread Alexandre Badez
On Sep 25, 2:24 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Alexandre Badez wrote: > > I would like to do something like: > > > s = r"a\tb\n" > > print unraw(s) # <= this is the "magic" function I'm searching for > > # result with &

Launching command on windows

2007-09-27 Thread Alexandre Badez
Hy, I'm working on windows and I try to do something like: import os APP = os.path.abspath("C:\\Program Files\\Notepad++\\notepad++.exe") FILE1 = os.path.abspath("D:\\Documents and settings\\test1.py") FILE2 = os.path.abspath("D:\\Documents and settings\\test2.py") command = '"%(app)s" "%(file1)s

Re: Launching command on windows

2007-09-27 Thread Alexandre Badez
On Sep 27, 4:20 pm, [EMAIL PROTECTED] wrote: > > I got it to work using subprocess.Popen > > Not sure why it doesn't work with os.system though. > > Mike Thanks Mike and Mauro, Mauro, your solution do not seems to work (or I made a mistake..) Mike your solution work great, thanks. But, I steel th

Re: Cross-platform GUI development

2007-10-12 Thread Alexandre Badez
On Oct 12, 10:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've been programming in Python for 5 or more years now and whenever I > want a quick-n-dirty GUI, I use Tkinter. This is partly because it's > the first toolkit I learnt, but also because it's part of the standard > Python distr

Re: pydev code completion problem

2007-10-15 Thread Alexandre Badez
On Oct 14, 9:45 pm, Lukasz Mierzejewski <[EMAIL PROTECTED]> wrote: > Hi, I need help with pydev code completion... > > Let's assume that we have something like this: > > class One: > def fun(self): > return 1 > > class Two: > li = [] > li.append(One()) > > on

Re: PyQt ProgressBar

2007-10-16 Thread Alexandre Badez
On Oct 16, 8:03 am, luca72 <[EMAIL PROTECTED]> wrote: > No one can help pls > > Regards > > Luca I've written a little app for testing this: import sys import time from PyQt4 import QtGui app = QtGui.QApplication(sys.argv) barra = QtGui.QProgressBar() barra.show() barra.setMinimum(0) barra.setM

Re: Automatically organize module imports

2007-10-16 Thread Alexandre Badez
On Oct 16, 8:52 am, Thomas Wittek <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone: > > > On Mon, 15 Oct 2007 20:52:11 +0200, Thomas Wittek > > <[EMAIL PROTECTED]> wrote: > >> Is there a tool that can organize my import section? > > > Pyflakes will tell you which imports aren't being used (among ot

Re: Automatically organize module imports

2007-10-16 Thread Alexandre Badez
On Oct 16, 12:08 pm, Thomas Wittek <[EMAIL PROTECTED]> wrote: > Great. It has a warning about unused imports. Perfect. > (Though, it was a bit tricky to install as easy_install didn't get the > dependencies right on Win XP) > > Thank you! > -- > Thomas Wittek > Web:http://gedankenkonstrukt.de/ > Ja

Dynamic and lazy import

2007-10-16 Thread Alexandre Badez
Hye everyone, I'm would like to do something a bit tricky. I would like when I do something like to create a __init__ package's (here calle my_package) file witch make an action when we try to import something in this package... Quiet like __getattribute__ work for a class, I would like this kin

Re: Dynamic and lazy import

2007-10-17 Thread Alexandre Badez
Thanks for all your advices, but it's not really what I would like to do. I'm going to be more clearer for what I really want to do. Here we have got many library for different applications. All those library have a version and between a version and an other, there isn't always a very good backwa

Re: Write by logging.FileHandler to one file by many processess

2007-10-17 Thread Alexandre Badez
On Oct 17, 3:33 pm, Rafa Zawadzki <[EMAIL PROTECTED]> wrote: > Hello. > > As I saw in logging source - there is no lock per file during making emit() > (only lock per thread). > > So, my question is - is it safe to log into one file using many processess > uses logging logger? > > Cheers, > -- > b

Re: Dynamic and lazy import

2007-10-17 Thread Alexandre Badez
On Oct 17, 3:56 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Alexandre Badez wrote: > > Thanks for all your advices, but it's not really what I would like to > > do. > > > I'm going to be more clearer for what I really want to do.

Better writing in python

2007-10-24 Thread Alexandre Badez
I'm just wondering, if I could write a in a "better" way this code lMandatory = [] lOptional = [] for arg in cls.dArguments: if arg is True: lMandatory.append(arg) else: lOptional.append(arg) return (lMandatory, lOptional) I think there is a better way, but I can't see how... -- htt

Re: Better writing in python

2007-10-24 Thread Alexandre Badez
On 10/24/07, J. Clifford Dyer <[EMAIL PROTECTED]> wrote: > > On Wed, Oct 24, 2007 at 12:09:40PM -0000, Alexandre Badez wrote regarding > Better writing in python: > > > > lMandatory = [] > > lOptional = [] > > for arg in cls.dArguments: > >

Re: Better writing in python

2007-10-24 Thread Alexandre Badez
Thanks for your try Cliff, I was very confused :P More over I made some mistake when I post (to make it easiest). Here is my real code: with dArguments = { 'argName' : { 'mandatory' : bool, # True or False [...], # other field we do not care here } } lMandatory = [] lOptional = [] fo

Re: Better writing in python

2007-10-24 Thread Alexandre Badez
On Oct 24, 3:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > For a 'python like' look lose the Hungarian notation (even Microsoft > have largely stopped using it) I wish I could. But my corporation do not want to apply python.org coding rules > increase the indentation to 4 spaces, Well, it is