Hi Vivek,

On Tue, 13 Jul 2010 13:18:07 -0400 Vivek Ranjan <vran...@gmail.com> wrote:

> Thank you once again. I have been trying to change the color of the cell.
> 
>   cell = []
>   cell.append(CYLINDER)
>   cell = cell + vert_000 + vert_100 + [radius] + [0,0,0] + [1,0,0]
>   cell.append(CYLINDER)
>   cell = cell + vert_000 + vert_010 + [radius] + [0,0,0] + [0,1,0]
>   cell.append(CYLINDER)
> 
> 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
> "http://pymol.sourceforge.net/newman/user/S0500cgo.html";
> 
> 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
the arguments:

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.

Cheers,
Rob
-- 
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
<robert.campb...@queensu.ca>    http://pldserver1.biochem.queensu.ca/~rlc

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to