Re: [PyMOL] Save command output to a file in pymol

2017-01-14 Thread Thomas Holder
Spencer's example was in PyMOL command syntax (.pml script). To use it in a Python script, it would look like this: from pymol import cmd, stored stored.f = open("ss.txt", "w") cmd.iterate("n. CA", "stored.f.write(resi + ':' + ss+'\n')") stored.f.close() Cheers, Thomas On 13 Jan 2017, at

Re: [PyMOL] Save command output to a file in pymol

2017-01-13 Thread Academic Research
Thank you for your replay. Running the command from a python code is much better for me. But can you elaborate more about the code? it still gives me a syntax error: file.py import pymol f=open("ss.txt","w") iterate n. CA, f.write(resi + ':' + ss+"\n") f.close() Result: File "1.py",

Re: [PyMOL] Save command output to a file in pymol

2017-01-13 Thread Spencer Bliven
This can be done using normal python file i/o: f=open("ss.txt","w") iterate n. CA, f.write(resi + ':' + ss+"\n") f.close() On Fri, Jan 13, 2017 at 10:38 AM, Academic Research wrote: > That would be good as well, How? > > keep in mind, my protein is synthetic, it is not

Re: [PyMOL] Save command output to a file in pymol

2017-01-13 Thread Academic Research
That would be good as well, How? keep in mind, my protein is synthetic, it is not from the PDB database, and the .pdb file only contains ATOMS, no header or anything else. On Jan 13, 2017, at 12:37 pm, Albert wrote: I think you can obtain it from your Linux  terminal

Re: [PyMOL] Save command output to a file in pymol

2017-01-13 Thread Albert
I think you can obtain it from your Linux terminal On 01/13/2017 10:34 AM, Academic Research wrote: Pymol Professionals I need your help, I have the following command: |iterate n. CA, print resi + ':' + ss | I use this command in pymol to print out each residue number and its

[PyMOL] Save command output to a file in pymol

2017-01-13 Thread Academic Research
Pymol Professionals I need your help, I have the following command: iterate n. CA, print resi + ':' + ss I use this command in pymol to print out each residue number and its corresponding secondary structure. The command prints out the result in pymol itself. My question is: How can I save