RPA Studio, python scripts and modules

Hello, I’m having trouble organising my python code into submodules.

ATM I have a flow which just runs a python script. This works ok.

Now I’m trying to tidy up and separate this script into modules to be reused in other flows but I’m unable to do it.

From main I tried:

  • import helpersBDT
  • from . import helpersBDT
  • from helpersBDT import timestampString

I either get

  • ImportError: attempted relative import with no known parent package
  • ModuleNotFoundError: No module named ‘helpersBDT’

I have my helpersBDT.py in the same folder as the original script and I added a init.py file.

I’m running out of ideas.

Thanks,
Ana

Hi Ana, thank you for your query. Currently the flows or python scripts cannot be published into packages which can then be imported into flows.
If you want to reuse/call the standalone flow (with python script) you can use it as a subflow using absolute path.

Regards
Manpreet