Use Python blocks!

> Something like that:
>       if (count_atoms nt) == 0
>       then cmd.delete("nt")

if cmd.count_atoms("nt") == 0: \
   cmd.delete("nt")

Note the explicit use of "continuation" lines via backslashes.   This ensures 
that PyMOL hands over both lines to the Python interpreter as a single block.

Cheers,
Warren

--
Warren L. DeLano, Ph.D.                     
Principal Scientist

. DeLano Scientific LLC  
. 400 Oyster Point Blvd., Suite 213           
. South San Francisco, CA 94080 USA   
. Biz:(650)-872-0942  Tech:(650)-872-0834     
. Fax:(650)-872-0273  Cell:(650)-346-1154
. mailto:war...@delsci.com      
 

> -----Original Message-----
> From: pymol-users-ad...@lists.sourceforge.net 
> [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of 
> Sebastien Moretti
> Sent: Thursday, September 29, 2005 8:43 AM
> To: pymol-users
> Subject: [PyMOL] test in pymol scripting language
> 
> Hello,
> Is there a way to use test commands in pymol scripting language ?
> 
> Something like that:
>       if (count_atoms nt) == 0
>       then cmd.delete("nt")
> 
> Thanks
> 
> --
> Sébastien Moretti
> http://www.igs.cnrs-mrs.fr/
> CNRS - IGS
> 31 chemin Joseph Aiguier
> 13402 Marseille cedex
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, 
> discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pymol-users
> 
> 
> 
> 

Reply via email to