Parser in python

I am new to GNURADIO and are trying to have my python script take a file
as a parameter and making gnuradio read this file and decode the
message. But it reads the wav file in the init procedure, so when I
am calling the setVariable function, the file is already read, making
the parameter useless.
Does anyone have a clue or an exmaple to how to do this?