This is architecturally impossible in PyMOL due to clash between the
asychronous nature of GUI event handling and the synchronous nature of
script execution using the main thread.
Right now, the best thing you can do is add a new command into the
language which calls your function followed by the text provided
def my_fn(*args): print args
Now, the user can type...
...to call your function.
However, I would like to understand your intended use case in greater
detail so that we can find an easier way of providing such interactivity
in the future. Perhaps we could do this by running such scripts in a
subordinate thread and then emulating "raw_input" behavior on the main
Another approach would be a prompting mechanism which would
automatically call a provided function with the next line of input.
Warren L. DeLano, Ph.D. =20
. DeLano Scientific LLC =20
. 400 Oyster Point Blvd., Suite 213 =20
. South San Francisco, CA 94080 USA =20
. Biz:(650)-872-0942 Tech:(650)-872-0834 =20
. Fax:(650)-872-0273 Cell:(650)-346-1154
. mailto:warren@... =20
> -----Original Message-----
> From: pymol-users-admin@...
> [mailto:pymol-users-admin@...] On Behalf Of=20
> evangelos papadopoulos
> Sent: Monday, October 17, 2005 5:03 AM
> To: pymol-users@...
> Subject: [PyMOL] How to raw_input() from windows Pymol?
> Hello all,
> I am using the windows binaries for PyMol. Whereas in=20
> Python it is easy to do a:
> When I use PyMol under windows it either gets crashed or=20
> halted while I am unable to input from keybord. I searched in=20
> this email list and I found some similar questions but no answer.
> I need this for a script that I am writing to get input from=20
> the user.=20
> Is there any way to do that under windows or any other way to=20
> interactivelly input some data from the keybord into a Pymol=20
> script under windows? Has any ever done it and could it be=20
> that just I have some wrong settings in windows or in the way=20
> I run the script? Maybe that can be done under linux/unix=20
> Pymol and be imposible under windows?
> Thank you & Best wishes
> /Cheers, Evangelos.
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads,=20
> discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
> PyMOL-users mailing list