Except for Ex commands like :edit
, special symbols like %
aren't automatically expanded. You need to use the Vimscript expand()
function to explicitly do this. Then, interpolate the result (as a String) to the :PyInteractiveEval
command, like this:
:execute 'PyInteractiveEval execfile(' . string(expand('%:p')) . ')'