It looks like you could define a variable called file , which is a string. Python then complains that str objects are not callable when it encounters
file(...)
You can avoid the problem by changing it by changing file to open .
You can also avoid the problem by not naming the file variable.
Currently, the best way to open a file is with -statement :
with open(outfile+'.x.betas','a') as f_handle: np.savetxt(f_handle,dataPoint)
This ensures that the file is closed when Python leaves with -suite.
source share