Another approach would be appending to sys.path, and loading the scripts
with import instead of run.
Arne Dieckmann wrote:
> That is a hot tip. However, can I also specify some path that would tell
> pymol the location of my scripts? I have a number of scripts that I need to
> call while alread
Hi Arne,
You could modify it like this:
python
# make a list of all your directories w/scripts
known_directories = [ "/path/to/dir1", "/path/to/dir2", ... ]
import glob
for p in known_directories:
for f in glob.glob(p+/*.py"):
cmd.do("run " + f)
python end
Cheers,
-- Jason
On M
That is a hot tip. However, can I also specify some path that would tell pymol
the location of my scripts? I have a number of scripts that I need to call
while already in Pymol and I do not want to type in the complete path every
time. Also, copying these scripts to the current working directory
Hi Lina,
Here's my trick for doing this. I created a directory called
pymol_scripts. Then, the scripts I download from the PyMOLWiki are put
them into this directory. Then using the following code in my
.pymolrc, PyMOL will automatically run these scripts for me on
startup:
python
import glob
for
Hi Lina,
you can put a .pymolrc file in your home directory, it's a script that
PyMOL will read on each startup. You can have it either in PyMOL syntax
or as a python script, depending on the file extension.
/home/lina/.pymolrc (in PyMOL syntax)
/home/lina/.pymolrc.py (in python syntax)
Hi,
Just a quick Q:
How can I better organize those *.py I mainly obtained from pymol wiki,
not those can be installed by the plugins,
pymol run in different directory each time.
Thanks,
--
Best Regards,
lina
--
B