Hi Daniel,
Use \t in stead of \n to separate the numbers from one measurement with
tabs, in stead of newlines. Do write one newline before the new series:
f.write('\n')
However, you might want to be a bit smarter in writing code. So you're
trying to get one angle for all states?:
f = open('NE_S_C.txt','w')
angles = [ cmd.get_angle('39/NE2', '144/SG', '221/C', state) for state in
range(1,cmd.count_states()+1) ]
f.write("\t".join(["%.3f"%angle for angle in angles]))
f.write('\n')
...
f.close()
Hope it helps,
Tsjerk
On Thu, Oct 13, 2016 at 8:31 PM, Daniel Munoz Escudero <dmun...@unal.edu.co>
wrote:
> Hello!
>
> I'm trying to get multiple measures of angles and distances between some
> residues for 232 states of the same molecule in PyMOL . I'm using this
> command for that:
>
> f=open('NE_S_C.txt','w')
> var1=cmd.get_angle('39/NE2', '144/SG', '221/C', 1)
> f.write("%8.3f\n"%var1)
> var2=cmd.get_angle('39/NE2', '144/SG', '221/C', 2)
> f.write("%8.3f\n"%var2)
> ...
> f.close()
>
> That creates a file called NE_S_C.txt with all my angles in one column.
> This means that in order to get the another measures, I repeat the process
> over again changing the angle command by the atoms I want. I'd like to do
> the another measures in the same script but I don't know how to print them
> in the same file separated by columns. I imagine it has something to do
> with the "f.write" part, but I just can't figure it out yet.
>
> I'd be glad if anyone could give me a help.
>
> Thank you.
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>
--
Tsjerk A. Wassenaar, Ph.D.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net