Entering edit mode
7.2 years ago
Hi friends, I am trying to create a python script which can load a protein molecule from a .pdb file and export it as .png file in pymol, without the GUI opening up. This is my script :
#!/usr/bin/env python
import __main__
__main__.pymol_argv = [ 'pymol', '-c']
import sys, time, os
import pymol
pymol.finish_launching()
spath = os.path.abspath(sys.argv[1])
sname = spath.split('/')[-1].split('.')[0]
pymol.cmd.load(spath, sname)
pymol.cmd.disable("all")
pymol.cmd.enable(sname)
pymol.cmd.hide('all')
pymol.cmd.png("my_image.png")
pymol.cmd.quit()
I am not getting a png image of the molecule. Pls help me out.