Support > Forums > OpenBots Studio > Output from python script command

Output from python script command

Harshal Chaudhari

  • Reporter
  • Calender Icon January 12,2023 at 4:45 PM

Hi,

I'm trying to get the output from the Python scripts command, but I can't get any output from the Python script, I just get an empty ("") string

The script is very simple since I'm testing the output.

def TestMethod(str1): str1 = 'Test2' return str1

I have an assigned string variable to the output, but I don't get anything.

This forum has 317 topics, 687 replies, and was last updated 4 months ago by Nataly Alvarado...

Nataly Alvarado...

  • Participant
  • Calender Icon January 12,2023 at 5:32 PM

Hi Harshal Chaudhari,

Please note that the python commands are based on the console output invocation, equivalent of running a python script using the "python 'FILEPATH.py'" command.

Because of this, the output needs to be formatted accordingly. For example, based on the sample shared, you would need to print the return_abc function. See sample below:

import sys import ctypes

def return_abc(): str = 'abc' return str

print(return_abc())

Note that additional features to the python commands and integration will be included in upcoming releases.

Stay tuned!

You are not authorized to reply, please click here to login and add your reply to this topic.