Writer.writerow((index, atom.atomicNumber, x, y, z)) With open(atom_table_path, 'wt') as fout: # generate full path for file with atom data When run in the Python terminal of Avogradro, the following snippet writesįor all atoms of the currently opened molecule to a csv file into an existing tmp directory in the user's home.Ītom_table_path = os.path.join(home, data_dir, atom_table_name) In Avogadro, open a Python Terminal (In German, this is done viaĮinstellungen -> Werkzeugleisten -> Python-Terminal, which should be something like Settings -> Tool bars -> Python terminal. ( Note that I'm using Avogadro 1.1.1 on Linux in German, your menus will have different labels.) The easiest way is the build-in Python-Terminal. There is however a different way to get your hands on the numbers.Īvogadro features objects: molecules, bonds and atoms are instances of classes, whose properties can be read and processed by programming. I am not aware of a menu button to print these tables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |