Bash: Permission Denied

I’m trying to run a Python script in Xojo. I added a Shell object (Shell1) to the main window and ran this code:

Var Shell1 As New Shell
Shell1.Execute("/Users/robertcampanaro/Desktop/PrintTest/PrintTest.py")

Var CellText As String
CellText = Shell1.Result
TextField1.Text = CellText

But it’s telling me that permission is denied.

The folder and the script are both Read & Write. Any ideas?

Thanks!

Make sure the script is executable. If that doesn’t work, you may need to prefix that with the full path to python itself.

Remember: She’ll doesn’t have an environment set up like Terminal does.

Is the App sandboxed? If so it wouldn’t be able to access the script.

Ian, I wouldn’t think so. I’m just running it in the debugger.

Then it won’t be unless you have a post build script that is doing that. AppWrapper for example.

you need path to python interpreter and then add the script file like so:

"/path/to/python /Users/robertcampanaro/Desktop/PrintTest/PrintTest.py"

2 Likes

That was it! Many thanks!!

1 Like