Python Help
May. 14th, 2007 04:51 pmI am not sure that anyone here has experience with Python, but I am having some code issues. I am trying to create a loop that will create several iterations of the process combining different variables. The relevant part looks like this:
bulkcell = []
for a in (4.55, 5.2, 0.10):
for c in (2.8, 3.05, 0.05):
bulk append (a, 0, 0),
(0, a, 0)
(0, 0, c)])
bulkcell = ([(a, 0, 0)
(0, a, 0)
(0, 0, c)])
bulk.SetUnitCell(bulkcell)
The problem is that when I look at the file that it creates it tells me that the cell dimensions are 0.1X0.1X0.05, meaning that it is taking what I was thinking of as the step as the input instead of the range of numbers that I thought that it would. Also it only does this once; there are no other permutations.
I have been trying to look up similar looping code examples and instruction, but for the most part I am find examples that are integer only for indexing purposes. Can anyone help?
bulkcell = []
for a in (4.55, 5.2, 0.10):
for c in (2.8, 3.05, 0.05):
bulk append (a, 0, 0),
(0, a, 0)
(0, 0, c)])
bulkcell = ([(a, 0, 0)
(0, a, 0)
(0, 0, c)])
bulk.SetUnitCell(bulkcell)
The problem is that when I look at the file that it creates it tells me that the cell dimensions are 0.1X0.1X0.05, meaning that it is taking what I was thinking of as the step as the input instead of the range of numbers that I thought that it would. Also it only does this once; there are no other permutations.
I have been trying to look up similar looping code examples and instruction, but for the most part I am find examples that are integer only for indexing purposes. Can anyone help?