> Two more questions: > Does the 'pymol -qc' takes command line variables (os.argv in python)? > For example, the first line of my script would be: > cmd.do('load %s' %os.argv[1])
That's not possible. In order to get this behavior (for now) you need to treat PyMOL as a module (see below). > Second question might be off a little bit. > Is it possible to wrap PyMol as a module of Python? Yes, but to do this (in most cases), you'll have to recompile and install PyMOL as a standard "distutils" module. If you're not familiar with compilation, then this isn't for you... python setup.py build install python setup2.py install Then from python import pymol pymol.finish_launching() can work > I know can be > installed as a Python module, but that doesn't seem to be able to let me > do things like: > > # Sample Python script > import PyMol > PyMol.cmd.do('......') > distance = PyMol.cmd.do('distance ......') Close. from pymol import cmd distance = cmd.distance('tmp',sele1,sele2) > Does it make any difference whether or not I installed PyMol independant > of Python? > I am a bit confused with cmd.do vs cmd.select. cmd.do places string command to the PYMOL parser input queue and returns nothing. cmd.functionName calls the PyMOL API and returns the result (if any). > So, if I am writing a script for running in PyMol(using @some_script.py), > I should use: > import PyMol > cmd.select('...') > > If I am writing a script for running PyMol in command line, > I should use: > from PyMol import cmd > cmd.do('...') The only time you'd use cmd.do is for convenience... cmd.do("select cas, name ca") will always be substantially slower than cmd.select("cas","name ca") because an extra parsing step in involved. Cheers, Warren > Kind of confused... > > -shuhsien > > >Shu-hsien > > > >Sure, instead of cmd.select, use > > > >cmd.do("select ligand, resn XYZ") > >cmd.do("select protein, ! ligand ") > > > >etc. > > > >./pymol -qc select_box.py > > > >Is the command line mode of PyMOL. "pymol -qc" can be used like > >"python" in most cases. > > > >Cheers, > >Warren > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > PyMOL-users mailing list > PyMOL-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pymol-users