# Set block parameters / variables from cmd line?

**URL:** <https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395>\
**Category:** GNU Radio\
**Created:** [April 3, 2015, 9:52am UTC](https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395 "2015-04-03T09:52:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 3, 2015, 9:52am UTC](https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395/1 "2015-04-03T09:52:41Z")

</div>

Hi,

i want to run an gnuradio .py application from the command line and want  
to choose parameters (like the frequency or sound level) on the command  
line. So i think about if it is possible to set block parameters /  
variables without graphical sliders or graphical textboxes from the  
command line.

Like:

python application.py -f frequency -s sound\_level

cheers,  
Andy

---

<div class="post-metadata">

**Author:** ![andreas\_l](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@andreas\_l](https://www.ruby-forum.com/u/andreas_l)\
**Post date:** [April 3, 2015, 9:58am UTC](https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395/2 "2015-04-03T09:58:01Z")

</div>

You want a “Parameter” block, from the Variables section.

On Fri, Apr 3, 2015 at 12:51 AM, Andreas L.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> cheers,  
> Andy
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

–  
GDB has a ‘break’ feature; why doesn’t it have ‘fix’ too?

---

<div class="post-metadata">

**Author:** ![andreas\_l](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@andreas\_l](https://www.ruby-forum.com/u/andreas_l)\
**Post date:** [April 3, 2015, 7:21pm UTC](https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395/3 "2015-04-03T19:21:38Z")

</div>

If i use the parameter block with the default “ID=parameter\_0” and with  
“Type=Int” and type on the cmd line:

python application.py --parameter\_0 10

i get the error message:

application.py: error: no such option: --parameter\_0

Do i understand something wrong about the parameter block ?

Am 03.04.2015 um 09:56 schrieb Chris K.:

---

<div class="post-metadata">

**Author:** ![andreas\_l](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@andreas\_l](https://www.ruby-forum.com/u/andreas_l)\
**Post date:** [April 3, 2015, 9:09pm UTC](https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395/4 "2015-04-03T21:09:58Z")

</div>

Hi Chris,

That’s it. Thank you very much 🙂

Andy

Am 03.04.2015 um 19:50 schrieb Chris K.:

---

<div class="post-metadata">

**Author:** ![andreas\_l](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7bcc69/32.png) [@andreas\_l](https://www.ruby-forum.com/u/andreas_l)\
**Post date:** [April 3, 2015, 7:52pm UTC](https://www.ruby-forum.com/t/set-block-parameters-variables-from-cmd-line/241395/5 "2015-04-03T19:52:11Z")

</div>

here’s an example. “python parameter\_demo.py --help”

maybe run your script with --help to see what options it will accept…

On Fri, Apr 3, 2015 at 10:20 AM, Andreas L.
