[Pythonmac-SIG] How can I include command line arguments in bundled apps?

Peter Steiner unistein at gmx.ch
Mon Oct 4 16:45:38 CEST 2004


Am 04.10.2004 um 16:02 schrieb Jack Jansen:
>
> On 4-okt-04, at 12:08, Peter Steiner wrote:
>
>> I tried editing IDLE.app/Contents/MacOS/IDLE adding the switches with
>>
>> sys.argv.insert(1, "-n")
>> sys.argv.insert(0, "-Qnew")
>>
>> just after
>>
>> sys.argv.insert(1, mainprogram)
>
>> but then the bundle wouldn't start anymore.
>
> I don't see why this wouldn't work. Cou you try running 
> /Applications/MacPython-2.3/IDLE.app/Contents/MacOS/IDLE from the 
> command line to see whether it produces any error output? And/or check 
> the console window to see whether there's anything there...

I got sys.argv slightly wrong. With

sys.argv.insert(1, mainprogram)
sys.argv.insert(2, "-n")
sys.argv.insert(1, "-Qnew")

it works from the command line. Double-clicking in the Finder does not 
work; console.log has the following:

> Error: option -p not recognized
>
> USAGE: idle  [-deins] [-t title] [file]*
> ...(rest skipped)

Regards, Peter
-- 
Peter Steiner <unistein at gmx.ch>         PGP-ID 0x02850F53 (DH/DSS)
PGP Fingerprint 68AB D08E D995 41B4 C6FD  639D 9B94 D249 0285 0F53



More information about the Pythonmac-SIG mailing list