I had developed an app using py2app. Used python 2.7 on mac osx 10.9 When I launch the app(by clicking on any file), it starts performing the required action of opening file through default file opener and then monitoring the file changes. I am passing filename as argument in the python code. But app is not able to open multiple files at a time. I found issue with py2app as py2app issue So, is there any other way to convert python code into an app, so that multiple instance(process) can be generated of an app
Asked
Active
Viewed 328 times
1 Answers
1
This appears to be the same question as Launch multiple process of an app on mac osx.
The only workaround for the explanation in that question I can come up with is to split your application into two parts: a wrapper script that will be the main application, and the real script that's used as an "--extra-scripts". The wrapper script would forward the arguments to the real script and exit, something like:
# wrapper.py
import os, subprocess, sys
appdir = os.path.dirname(sys.argv[0])
subprocess.Popen([
os.path.join(appdir, "real-script")] + sys.argv[1:])
sys.exit(0)
And in setup.py:
setup(
name="MyApp",
app=["wrapper.py"],
options=dict(py2app=(extra_scripts=["real-script.py"])))
(All of code was typed into the answer without testing, there might be some bugs left)

Community
- 1
- 1

Ronald Oussoren
- 2,715
- 20
- 29