Hi Xiang-Jun,

Some commands accept the semicolon in their argument list and thus cannot be 
followed by other commands on the same line. The "label" command is one of them.

See this table and the last column with "parsing.LITERAL1":
https://github.com/schrodinger/pymol-open-source/blob/master/modules/pymol/keywords.py#L140

You could work around this by using Python syntax:

cmd.label("*", "name");cmd.color("red")

Cheers,
  Thomas

> On Nov 15, 2018, at 12:23 AM, Xiang-Jun Lu <3dna...@gmail.com> wrote:
> 
> I am surprised by the PyMOL error message with the following commands:
> 
> # this is fine
> color red; label *, name 
> 
> # reversing the order causes problems
> label *, name; color red
> 
> =================================
> PyMOL>label *, name; color red
>   File "", line 1
>     name; color red
>         ^
> SyntaxError: invalid syntax
> Label-Error: failed to compile expression
>  Label: labelled 0 atoms.
> =================================
> 
> Replacing 'name' with 'resi' or 'resn' etc has the same result.
> 
> Issuing each command separately works as expected. The error message shows up 
> only if "label *, name" is followed by another command, on the same line.
> 
> I am using "Version 1.8.7.0 Open-Source" on macOS.
> 
> Any ideas?
> 
> Thanks,
> 
> Xiang-Jun
> 
> --
> Xiang-Jun Lu (Ph.D.)
> Email: xiang...@x3dna.org
> Web: http://x3dna.org/
> Forum: http://forum.x3dna.org/

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.



_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Reply via email to