It's difficult to say anything concrete from a stack trace without any other
information. My guess is that g_f in 'File "/home/jrp/GRAF/e_gops.py", line
152' is not a file object or a string, as it should be.
Please remember to *always* provide a minimal and self-contained example
that shows the problem.
Best,
Tiago