Skip to main content
New Participant
May 5, 2023 12:21 PM UTC

Is it possible to pass in parameters into RUNPY?

I'm using universe 11.3.4 and want to pass in parameters in when running a python program using RUNPY is this possible?



------------------------------
Neil Sherwood
Analyst Programmer
HSBC Global Services (UK) Limited
London GB
------------------------------

    1 reply

    Michael Brady
    New Participant
    May 8, 2023 1:46 PM UTC

    I'm using universe 11.3.4 and want to pass in parameters in when running a python program using RUNPY is this possible?



    ------------------------------
    Neil Sherwood
    Analyst Programmer
    HSBC Global Services (UK) Limited
    London GB
    ------------------------------

    Yes, there a shared variable between UV and Python called sys.argv.  works like the param variable.
    Python:
         testparam.py

    import sys

    try:
    my_param = sys.argv[1]
    except:
    my_param = 'Nothing_Passed'

    print(my_param)

    Universe:
      RUNPY testparam.py SomeText






    ------------------------------
    Michael Brady
    Application Architect
    Integrated Supply Network Inc
    Lakeland FL US
    ------------------------------