From: Niels L. E. <nie...@gm...> - 2005-10-06 07:10:21
|
> The magical incantation you seek is as follows: Thank you both for all the help. Is this list always so entertaining? For the sake of google. Here is a python script that writes a temporary jmol script and invokes jmol. #!/usr/bin/python import os import sys datafile =3D sys.argv[1] scriptfile =3D "myjmol_script_%s"%datafile f_out =3D open(scriptfile,mode=3D'w') f_out.write("set autobond off;\n") f_out.write("load \"%s\"\n"%datafile) f_out.write("select hydrogen;\n") f_out.write("color atom red;\n") f_out.write("spacefill 0.4;\n") f_out.write("select helium;\n") f_out.write("color atom white;\n") f_out.write("spacefill 0.5;\n") f_out.write("set boundbox on;\n") f_out.write("select all;\n") f_out.write("wireframe off;\n") f_out.close() os.popen("/usr/lib/j2re1.5-sun/bin/java -jar /home/niels/local/src/jmol-10.00/Jmol.jar -g 700x700 -s %s"%scriptfile) os.remove(scriptfile) |