On Thu, 22 Jan 2004, Warren L. DeLano wrote:
Where script.py contains the following sequence:
import pymol
pymol.finish_launching()
[PS If there's anyone out there with a more elegant alternative for
launching the PyMOL thread from a standalone Python script, I'd sure
like to hear it : )].
I don't have anything significant to contribute to a revised interface
right now, but I just wanted to say that I think it is strange that an
import statement starts doing things like launching threads. The
import should just make an interface available, and then the script
can use the interface to create a pymol object or whatever:
import pymol
pymolHandle = pymol.create(options like window size, parent window to create
in)
pymolHandle.cmd.show(sticks, someName)
The pymol.create() blocks until things are ready, so it is sort of the
same as calling pymol.finish_launching(), but it seems more natural to
this programmer. I don't expect import statements to do much. If I
import imaplib it doesn't create an interface to an IMAP server,
right? It just gives me the ability to do so.
It would be up to the application to maintain or pass around
pymolHandle to various modules/objects to get things done.
Perhaps an app could use pymol.create() to create another instance, a
second rendering window? Shared model underneath? Hmmm. . .
When I delete pymolHandle or it goes out of scope, the thread should
shut down and other resources should be released. It should NOT kill
my application as it currently does when I call cmd.quit(). It's just
a thread, it shouldn't be making decisions for my application.
-Bob
-Original Message-
From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users-
ad...@lists.sourceforge.net] On Behalf Of Takefumi Sora
Sent: Wednesday, January 21, 2004 10:57 PM
To: pymol-users@lists.sourceforge.net
Subject: RE: [PyMOL] How to send pymol command to pymol by python
interpreter
Hi.
I appreciate your answer, Warren.
Thank you.
Please let me ask one more question.
You said I need two lines first:
import pymol
pymol.finish_launching()
As long as I use,I can't the role of
pymol.finish_launching()
if I don't call this, what troubles will happen ?
Takefumi SORA
---
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users
---
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
___
PyMOL-users mailing list
PyMOL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pymol-users