On Tue, 13 Jul 2010 13:18:07 -0400 Vivek Ranjan <vranjan@...> wrote:
> Thank you once again. I have been trying to change the color of the cell.
> cell = 
> cell = cell + vert_000 + vert_100 + [radius] + [0,0,0] + [1,0,0]
> cell = cell + vert_000 + vert_010 + [radius] + [0,0,0] + [0,1,0]
> if I put cell.append(CYLINDER, [COLOR, 0, 0, 1]), pymol complains
> "TypeError: append() takes exactly one argument". If I add a line
> "cell.extend([COLOR, 0.0, 0.0, 1.0])" after the above
> cell.append(CYLINDER), nothing displays. There is also very little
> description of cgo on
> How to change the color of the cell ? What is append(), and extend() ?
> Is there a document that describes complete functionalities of CGO ?
> Basically, I would like learn how CGO, python, and openGL are
> connected within pymol.
The reference that you point to above notes that the CYLINDER primitive takes
CYLINDER, x1, y1, z1, x2, y2, z2, radius,
red1, green1, blue1, red2, green2, blue2,
If you want to change the color of the cell, then you should change the
two triplets of values within the square brackets after the radius. The line
in my script
cell = cell + vert_000 + vert_100 + [radius] + [0,0,0] + [1,0,0]
draws a cylinder coloured from black to red, while
cell = cell + vert_001 + vert_011 + [radius] + [0,0,1] + [0,1,1]
draws a cylinder coloured from blue to cyan.
As Jason answered, .append() and .extend() are python functions that apply to
lists. .append adds one element to a list, while .extend adds each of the
elements from its argument, which is itself an iterable object.
And I can't speak for others here, but since I read the e-mail list, there is
no need to CC: any e-mails for the list to my own address.
Robert L. Campbell, Ph.D.
Senior Research Associate/Adjunct Assistant Professor
Botterell Hall Rm 644
Department of Biochemistry, Queen's University,
Kingston, ON K7L 3N6 Canada
Tel: 613-533-6821 Fax: 613-533-2497