# Making a GUI to execute python scripts generated by GRC

**URL:** <https://www.ruby-forum.com/t/making-a-gui-to-execute-python-scripts-generated-by-grc/230436>\
**Category:** GNU Radio\
**Created:** [June 18, 2014, 7:24am UTC](https://www.ruby-forum.com/t/making-a-gui-to-execute-python-scripts-generated-by-grc/230436 "2014-06-18T07:24:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 18, 2014, 7:24am UTC](https://www.ruby-forum.com/t/making-a-gui-to-execute-python-scripts-generated-by-grc/230436/1 "2014-06-18T07:24:57Z")

</div>

Hi,  
I have written a python code(wxgui.py) for a simple GUI using  
wxPython.There is a button in it and by pressing that button i am  
executing another python file.It’s working fine and i am able to call  
any python file,but when i try to execute the python file created by  
GRC(uhd\_fft.py) i get the following error:

Form: \<class ‘gnuradio.wxgui.forms.forms.text\_box’\> -\> Error  
translating value: “\< **main**.MyFrame; proxy of \<Swig Object of type  
‘wxFrame \*’ at 0x30f44a0\> \>”  
bad operand type for abs(): ‘MyFrame’  
Enter a float with optional scale suffix. E.g., 100.1M  
Form: \<class ‘gnuradio.wxgui.forms.forms.  
slider’\> -\> Error translating value: “\< **main**.MyFrame; proxy of  
\<Swig Object of type ‘wxFrame \*’ at 0x30f44a0\> \>”  
unsupported operand type(s) for -: ‘MyFrame’ and ‘float’  
Value should be within slider range  
Using Volk machine: avx\_64\_mmx\_orc  
Traceback (most recent call last):  
File “wxgui.py”, line 26, in Execute  
self.aNewFrame = uhd\_fft.uhd\_fft(self)  
File “/home/ali/Desktop/WXGUI/uhd\_fft.py”, line 155, in **init**  
size=((-1, 400)),  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fftsink\_gl.py”,  
line 126, in **init**  
persist\_alpha=persist\_alpha,  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fft\_window.py”,  
line 304, in **init**  
self.update\_grid()  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/fft\_window.py”,  
line 401, in update\_grid  
baseband\_freq - sample\_rate/2.0,  
TypeError: unsupported operand type(s) for -: ‘MyFrame’ and ‘float’  
Traceback (most recent call last):  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py”,  
line 102, in   
widget.Bind(EVT\_DATA, lambda x: self.\_update(x.data))  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py”,  
line 248, in \_update  
def \_update(self, value): self.\_text\_box.SetValue(value);  
self.\_update\_color()  
File  
“/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/\_controls.py”,  
line 1754, in SetValue  
return _controls_.TextCtrl\_SetValue(\*args, \*\*kwargs)  
TypeError: String or Unicode type required  
Traceback (most recent call last):  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py”,  
line 102, in   
widget.Bind(EVT\_DATA, lambda x: self.\_update(x.data))  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/forms/forms.py”,  
line 181, in \_update  
def \_update(self, value): self.\_slider.SetValue(int(round(value)))  
TypeError: a float is required

Both files are as attached.Is there any other way for it?What am i  
doing wrong?This issue is bothering me since long.

Regards,  
Ali
