Jim,
This really has little to do with GNU Radio and more to do with Python/GUI concurrency.
As a general rule, a GUI should never perform a "blocking" operation. Since your application has its own "event loop", it is fatal to pass control to it from another event loop.
Rather than calling your application directly, consider the Python subprocess module. Stack Overflow is helpful.
---
Jim Melton
From: discuss-gnuradio-bounces+jim.melton=sncorp.com@gnu.org <discuss-gnuradio-bounces+jim.melton=sncorp.com@gnu.org> On Behalf Of Elmore Family
Sent: Wednesday, July 3, 2024 10:05
To: GNU Radio <discuss-gnuradio@gnu.org>
Subject: [EXTERNAL] Run a python script interactively from GNU Radio
You don't often get email from wa4ywm@comcast.net. Learn why this is important |
DO NOT click on links. Never open an email attachment unless you're 100% sure it's from a trusted source and you are expecting it.
I have an application which I can run successfully as a standalone Python script called from the terminal. When executed, this script is in a while loop.
I would like to execute the script from GNU Radio and interact with it. I have a toggle button which when pressed calls the script. Once the script begins execution I no longer have control from GNU Radio – the window does not respond. I realize this is because the script is in a while loop without any way to exit it (another issue).
Is there some way to run this script and still have a functioning GNU Radio? I would like to be able to exit the script, enter a value to be used by the script, set other parameters, etc. Is this possible or am I attempting to do something which is not within GNU Radio's purview?
This is a fairly complex project I have been working on for some time but this is the first time I tried something like this. I don't want to have to build all the OOTs that would be required to run this entirely in GNU Radio. It was difficult enough to develop a successfully executing script.
Jim
No comments:
Post a Comment