Mar-29-2022, 07:20 PM
Not according to your error message. According to the error message the problem is here:
output.write("%d %d %d" % (np.shape(kxx)[1], np.shape(kxx)[0], collapse_steps)I am surprised this is not showing up as a syntax error because of the mismatched parenthesis. So I loaded the code into my editor and is says these parenthesis match.
with open(file_ls, "w") as output: output.write("%d %d %d" % (np.shape(kxx)[1], np.shape(kxx)[0], collapse_steps) # expected ) here for ii in np.arange(np.shape(kxx)[1])) # Python says matching paren for write ( is end of this lineNow the message makes more sense. It sees the for loop inside the parenthesis for the argument list for the write() command and complains about the generator.