Spectrum Sensing

I would like to do spectrum sensing with GNU radio. Is there a good way
to
get the raw output from uhd_fft.py (the value for each frequency)? I
would
like to do this programatically (with code), rather than through a GUI.

I have tried doing spectrum sensing with usrp_spectrum_sense.py, and
this
script has questionable accuracy and seems to be much slower than
uhd_fft.py.

Thanks!