# Python and py2app help

**URL:** <https://forum.xojo.com/t/python-and-py2app-help/78443>\
**Category:** General\
**Created:** [December 8, 2023, 10:48am UTC](https://forum.xojo.com/t/python-and-py2app-help/78443 "2023-12-08T10:48:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Robert\_Livingston](https://forum.xojo.com/user_avatar/forum.xojo.com/robert_livingston/32/255_2.png) [@Robert\_Livingston](https://forum.xojo.com/u/Robert_Livingston)\
**Post date:** [December 8, 2023, 6:29pm UTC](https://forum.xojo.com/t/python-and-py2app-help/78443/2 "2023-12-08T18:29:48Z")

</div>

I do not know that this will help you, but I am throwing it out there on the off chance it might. Several years ago, I wrote various Xojo programs that called Python scripts. It worked beautifully. This is basically how I did it:

```auto
Const PATH_PYTHON3 = "/Users/koala/anaconda3/bin/python"
// get the path to the script that you want to run and place it in thePathname
Var thePathname As String 

Var pythonShell As New Shell
pythonShell.Mode = MODE_SYNCHRONOUS // the default anyway
pythonShell.Execute(PATH_PYTHON3, thePathname)

Var theAnswer As String
theAnswer = pythonShell.Result // Contains the contents of the output buffer

```

1. PATH\_PYTHON3 is just the path to where Python lives on your particular machine
2. thePathname is just the full path to the Python script you want to run

* * *

You can pass string arguments to the Python script as in the below

```auto
Const SP As String = " "
Var argument1, argument2 As String
argument1 = "whatever"
argument2 = "somethingelse"
pythonShell.Execute(PATH_PYTHON3, thePathname + SP + argument1 + SP + argument2)

```

Now my knowledge about all this is very rusty so I defer to others who might chime in. I am not confident that I actually understand your question since I do not know what _py2app_ is. 🥴

---

_[View the full topic](https://forum.xojo.com/t/python-and-py2app-help/78443)._
