Running Python Scripts

I am attempting to just run a simple Python print “Hello World” script. I have read everything there is in terms of using all the Python activities correctly. I am using Load Python Script with the file path, Invoke Python Method to run the method, Get Python Object to change the result to .NET, and a message box to display “Hello World”. Everything seems to be working correctly but the message box comes back blank. When I run the python script by itself it works correctly so I know that is not the issue.

Any ideas? Thanks

Hi @jpreziuso
Did u made python function or simple script?

At first I tried just a simple script but was getting errors. So now I have a function to print “Hello World”. I do not get any errors but the resulting message box comes back blank

did u use return in function as Hello World?
Try like this,
def hello():
output = “Hello world”
return output

I have

def Hello_World():
print(“Hello World”)
return Hello_World()

Hi use the scripts that i had mentioned
I think in your script it returns nothing @jpreziuso

Sorry mine is actually

def Hello_World():
print(“Hello World”)
Hello_World()

I tried to run yours in the Python Shell and I received errors

def hello():
output = “Hello world”
return output

hello()

Try like this @jpreziuso

1 Like

Ah I see now, I understand what you are saying. It is working now. Thank you for your help

Hi @jpreziuso

Did u tried my code?

Yes. It is working correctly. I was confused by print/return in functions

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.