In article <1039c916-1af4-4189-b2c7-c30149bf0...@auricom.com>, Ian McLean <i...@auricom.com> wrote: > I'm new to python/py2app. My original python script accepts arguments as > such: > > python merge.py -o outfile.txt - i infile1.txt infile2.txt > > Once I create the .app from py2app using argv emulation this no longer works > and I get the following feedback: > > new-host:dist Ian$ merge -o outfile.txt -i infile1.txt infile2.txt > merge: unknown option: -o > merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3 > merge: too many arguments
You are undoubtedly running the system-supplied merge command (/usr/bin/merge) rather than your app. In general, OS X apps, including those created with py2app, are designed to be "launched", for example from the Finder by clicking on their icon, rather than run from a command line. You *can* launch apps from the command line, for instance, with the open command (see man 1 open), or by "going under the covers" into the app bundle and executing the main executable file inside it. But if your intent is to just produce a command-line callable utility, then you probably don't want to be using py2app. The more conventional cross-platform approach using python's Distutils should be fine. Or if it's just a one-file script, add a shebang line to the file and make it executable: $ cat mymerge #!/usr/bin/env python # import ... $ chmod 755 mymerge $ ./mymerge -o ... -- Ned Deily, n...@acm.org _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG