Reputation: 496
I am using a package that has operations inside the class (? not sure what either is really), and normally the data is called this way data[package.operation]
. Since I have to do multiple operations thought of shortening it and do the following
list =["o1", "o2", "o3", "o4", "o5", "o6"]
for i in list:
print data[package.i]
but since it's considering i
as a string it doesnt do the operation, and if I take away the string then it is an undefined variable. Is there a way to go around this? Or will I just have to write it the long way?.
In particular I am using pymatgen
, its package Orbital
and with the .operation
I want to call specific suborbitals. A real example of how it would be used is data[0][Orbital.s]
, the first [0] denotes the element in question for which to get the orbitals s
(that's why I omitted it in the code above).
Upvotes: 0
Views: 136