Skip to main content
Question

Python function runs in manual script, but not as a control room file


Forum|alt.badge.img+6

I am not able to figure out why this is happening.

I have a simple function that just returns the same variable that is passed to it.

 

When I use the Python manual input, the function executes fine.

When I try to use the same function with a control room file, I always get 'bot error' as my output.

 

The code is just:

def test(part_no):

return part_no

 

I've tried more complex functions using pandas, and am able to get it running in manual input, but as soon as I try loading it as a control room file, it fails.

 

File:

imageManual:

image

3 replies

Forum|alt.badge.img+5
  • Navigator | Tier 3
  • 43 replies
  • August 17, 2022

Change the function and file from test.py and test to something else like - myTestFunction


Zaibi
Forum|alt.badge.img+6
  • Navigator | Tier 3
  • 128 replies
  • August 17, 2022

Hi @Dan Sleeman​,

 

You have to check your Input and Output parameters you have provided in Python script: Execute Function


Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • 12 replies
  • August 17, 2022

I can't understand why that was the problem, but uploading a new file called function_file.py seems to work.

 

Must be something with the name test.py. Wish the error message would provide some better details for troubleshooting.

 

Thanks!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings