That is not the correct syntax. It should be instead:
p_energy = pickle.load(open('p_energy.dat', 'rb'))
What you're actually doing is:
'rb'('p_energy.dat')
is trying to call the str
object 'rb'
with an argument of 'p_energy.dat'
, which is why you get the error 'str' object is not callable
.