Here's a simple crude solution:
$ cat a.py
a = 3.14
a *= 2
$ python <(cat a.py && echo '\nprint(a)')
6.28
There are various ways this might not work, but the constraints of your situation are not clear.
The \n is there to prevent a syntax error in the case that a.py does not end in a newline.