How to open 2 separate pymol windows from a script, and run commands after pymol window closes
0
0
Entering edit mode
3.1 years ago
Sam • 0

Hello,

In short, I'm playing around with pymol and have come across 2 problems.

  1. How can I open 2 separate windows of pymol from the same script

  2. Closing pymol closes the entire script. How do I continue running stuff after pymol is closed within my script?

Test code:

pymol import cmd
import pymol



def pymol_window_1():
    pymol.finish_launching()
    cmd.load('pdb_file.pdb')

def pymol_window_2():
    pymol.finish_launching()
    cmd.load('pdb_file.pdb')

def main():
    pymol_window_1()
    pymol_window_2()
    print('this')


main()

The issue with the above code is it will open the pymol window, but only one. I'd like 2 separate windows to open of the same pdb file within the same script.

Furthermore, the "this" that should be printed, never is. Once the pymol window closes the entire program closes. I found a thread where this issue was mentioned in 2005, and it was stated there the next version of pymol would allow you to do this, but I don't know how.

Any help would be greatly appreciated!

pymol • 826 views
ADD COMMENT

Login before adding your answer.

Traffic: 1630 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6