That looks fine.
Ok, let's troubleshoot a bit more.
Make a copy of your current "readTotalEnergy.py", let's say "readTotalEnergy_realone.py". This is just a backup. Then insert two lines into readTotalEnergy.py:
print file_data
return [1],[1]
right after the line "file_data = nlinspect(filename)".
Remember these two lines must be indented to the same level as "file_data = ", i.e. 4 spaces first on the line. Do not use TAB.
Run the command again (atkpython charge_stability_diagram_full.py) and let's see what it prints.