Hi, I'm having some trouble accessing a function defined at top level with alter_state in a python script launching pymol. Maybe I shouldn't be wanting to do this, but what I'm trying, and failing to do is exemplified by this script:
### #!/usr/bin/env python import pymol if __name__ == "__main__": pymol.finish_launching() def identity(x,y,z): print "YEAH!" return x,y,z # Fix: # setattr(pymol,"identity",identity) pymol.editor.build_peptide("GGGGG") pymol.cmd.alter_state(1,"all","(x,y,z)=identity(x,y,z)") ### The problem is that the function 'identity' (which may be given a more sensical form by actually doing something with the coordinates), is sought in the pymol namespace. I can't really figure out where I should be looking to directly call the function. Of course, I can register the function in the pymol module (uncomment the setattr line), but I don't think it's proper meddling with established modules like that. Does anyone know a better/cleaner solution? In addition, does anyone know how to suppress the GUI stuff when launching pymol like this? Groetjes, Tsjerk -- Tsjerk A. Wassenaar, Ph.D. post-doctoral researcher Molecular Dynamics Group * Groningen Institute for Biomolecular Research and Biotechnology * Zernike Institute for Advanced Materials University of Groningen The Netherlands ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ 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