Re: [PyMOL] Run script synchronized

2011-08-29 Thread Martin Hediger
Try this. import subprocess # propkaprocess # shell=False controls that the process remains in the same thread. propkap = Popen(['propka'], stdin=open('1pdb.pdb', 'r') stdout=subprocess.PIPE stderr=subprocess.PIPE shell=False) pr

Re: [PyMOL] Run script synchronized

2011-08-28 Thread Troels Emtekær Linnet
Thanks Jason. But still no luck... So, I changed it to a python script. It was important that the ending of the file is .py :-) But, I can see from the list of objects, that PyMOL fetches the next protein before it has finished propka first. Does pymol run external script in some kind of asynchron

Re: [PyMOL] Run script synchronized

2011-08-26 Thread Troels Emtekær Linnet
Well, I cant get it to work. Pymol speeds ahead of calling propka.propka Can you give an example of subprocess? --- import propka python resis = [["1bj6","36"],["1bj6","39"]] #resis = [["1bj6","36"],["1bj6","39"],["1bj6","49"],["1ag1","14"],["1gu9","133"],["1gu9","130"],[

Re: [PyMOL] Run script synchronized

2011-08-23 Thread Martin Hediger
you may want to check out the Popen class from the subprocess module... hth Martin On 23.08.11 10:48, Troels Emtekær Linnet wrote: Hi. If one writes a pymol script, and calls an external function, the pymol script continues its operation before waiting for the "success" of the external functi

Re: [PyMOL] Run script synchronized

2011-08-23 Thread Jason Vertrees
Hi Troels, Try putting your script inside a 'python' block: python your commands here... python end PyMOL also has a 'sync' command (http://pymolwiki.org/index.php/Sync). I prefer python blocks. Cheers, -- Jason 2011/8/23 Troels Emtekær Linnet : > Hi. > > If one writes a pymol script, and cal

[PyMOL] Run script synchronized

2011-08-23 Thread Troels Emtekær Linnet
Hi. If one writes a pymol script, and calls an external function, the pymol script continues its operation before waiting for the "success" of the external function. Is it possible to give a keyword, so it "waits" for the external function before preceding? Kind of the same function with: fetch

Re: [PyMOL] run script

2005-06-30 Thread Andrea Spitaleri
Hi, yes it worked. that mistake is so shameful ... :P thanks andrea 2005/6/30, lie...@ultr.vub.ac.be : > On Thursday 30 June 2005 13:26, Andrea Spitaleri wrote: > > from pymol import cmd > > file=open("file.nam") > > for i in file.readlines(): > > cmd.load(i) > > You may have to strip the tr

Re: [PyMOL] run script

2005-06-30 Thread lieven
On Thursday 30 June 2005 13:26, Andrea Spitaleri wrote: > from pymol import cmd > file=open("file.nam") > for i in file.readlines(): > cmd.load(i) You may have to strip the trailing newline ("\n") from each file name by using "cmd.load(i.strip())". Hope this helps, -- Lieven Buts Vrije Univ

Re: [PyMOL] run script

2005-06-30 Thread Lieven Buts
On Thursday 30 June 2005 13:26, Andrea Spitaleri wrote: > from pymol import cmd > file=open("file.nam") > for i in file.readlines(): > cmd.load(i) You may have to strip the trailing newline ("\n") from each file name by using "cmd.load(i.strip())". Hope this helps, -- Lieven Buts Vrije Univ

[PyMOL] run script

2005-06-30 Thread Andrea Spitaleri
Hi this is my "unsuccessful" first script for pymol. I have a series of files: prot1.pdb prot4.pdb prot55.pdb and so on I'd like to open them using a loop (instead to open one by one) I cat them to a file and then I tried to open all of them in pymol: from pymol import cmd file=open("file.nam") fo