Evangelos,

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

cmd.extend("my_fn",my_fn)

Now, the user can type...

my_fn argument-list

...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
thread.

Another approach would be a prompting mechanism which would
automatically call a provided function with the next line of input.

Cheers,
Warren

--
Warren L. DeLano, Ph.D.                     
Principal Scientist

. DeLano Scientific LLC  
. 400 Oyster Point Blvd., Suite 213           
. South San Francisco, CA 94080 USA   
. Biz:(650)-872-0942  Tech:(650)-872-0834     
. Fax:(650)-872-0273  Cell:(650)-346-1154
. mailto:war...@delsci.com      
 

> -----Original Message-----
> From: pymol-users-ad...@lists.sourceforge.net 
> [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of 
> evangelos papadopoulos
> Sent: Monday, October 17, 2005 5:03 AM
> To: pymol-users@lists.sourceforge.net
> Subject: [PyMOL] How to raw_input() from windows Pymol?
> 
> Hello all,
> 
>    I am using the windows binaries for PyMol. Whereas in 
> Python it is easy to do a:
> a=raw_input()
> When I use PyMol under windows it either gets crashed or 
> halted while I am unable to input from keybord. I searched in 
> 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 

> the user. 
> Is there any way to do that under windows or any other way to 
> interactivelly input some data from the keybord into a Pymol 
> script under windows? Has any ever done it and could it be 
> that just I have some wrong settings in windows or in the way 
> I run the script?  Maybe that can be done under linux/unix 
> 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, 
> discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pymol-users
> 
> 
> 
> 

Reply via email to