I found an answer :
color = gtk.gdk.Color()
and then use color for fg et bg
--
http://mail.python.org/mailman/listinfo/python-list
Hi.
No matter how I try, I just can't find this GdkColor class. I'm trying
to convert some data into a pixmap in order to display it. Here is my
code :
import pygtk
pygtk.require('2.0')
import gtk
xbm = """#define dump_width 4
#define dump_height 4
static unsigned char dump_bits[] = { 0xaa, 0x6c,
Hi there.
I have a list containing integer values from 0 to 255. With this list I
have informations width and height, as width * height = len(my_list)
What I want to do is to convert this array into a pixmap of dimension
width * height in order to draw it inside a pygtk GUI.
Any suggestions abou
It's alright I found where my mistake came from. I was misunderstanding
the meaning of "classmethod", thinking of it as an instance method.
--
http://mail.python.org/mailman/listinfo/python-list
Or maybe I'm mixing up what we call a "classmethod" with what we could
call an "instance method" ?
--
http://mail.python.org/mailman/listinfo/python-list
Hi there.
I'm trying to use new-style classes, but there is something i'm
obviously missing
here it is :
class Data(list):
__slots__ = ["width", "height", "label"]
def __init__(self,width,height,label=None):
list.__init__(self)
self.width = width
self.height = he
If your code is exactly what you've copy-pasted, then you are not
testing against an empty string but a "one blank space" string ...
I've just tried with :
while line != "":
and it works very well.
--
http://mail.python.org/mailman/listinfo/python-list
That's perfect. thanks.
--
http://mail.python.org/mailman/listinfo/python-list
thanks, you pointed exactly on what distrurbed me. I'll see what I can
do with cooperative methods.
--
http://mail.python.org/mailman/listinfo/python-list
Hi.
I think I'm missing something about multiple inheritance in python.
I've got this code.
class Foo:
def __init__(self):
self.x = "defined by foo"
self.foo = None
class Bar:
def __init__(self):
self.x = "defined by bar"
self.bar = None
class Foobar(Foo
Hi.
I found a lot of documentation about how to code in Python, but not
much about how you organize your code in various modules / packages ...
As I am not yet used to python, this puzzle me a bit.
So, can anyone explain how one should organize and store its code ? the
uses of __init__.py files ?
You are right, using __dict__ is what i needed.
But I chose the solution explained before because i don't want to list
all attributes of the object, only attributes that are instances of the
class Property (or a subclass of it).
--
http://mail.python.org/mailman/listinfo/python-list
Thanks a lot for all your answers !
Thanks to you I resolved this problem. Here is what i've done :
[...]
for (_,v) in getmembers(self):
if isinstance(v,Property):
st += "\t%s\n" % str(v)
[...]
as all the attributes I want to get are instances of Property or a
subclass of Property,
Hi there.
I'm trying to get a list of attributes from a class. The dir() function
seems to be convenient, but unfortunately it lists to much - i don't
need the methods, neither the built-in variables.
In fact, all my variables are referencing to objects of the same type.
Can anyone suggest me a w
Yum, food for thoughts. Thanks Diez.
--
http://mail.python.org/mailman/listinfo/python-list
Hello there.
I recently started looking at turbogears and I found code such as :
class Root(controllers.Root):
@turbogears.expose(html="blog.templates.accueil")
def index(self,**kw):
return dict()
What is this "@" ? I looked around but couldn't find any references to
this sy
16 matches
Mail list logo