Unix programmers and Idle

MRAB google at mrabarnett.plus.com
Mon Mar 30 22:28:44 EDT 2009


Gabriel Genellina wrote:
> En Mon, 30 Mar 2009 22:21:12 -0300, Dale Amon <amon at vnl.com> escribió:
> 
>>>>     vlmdeckcheck.py --strict --debug file.dat
>>>>
>>>> There must be a way to tell it what the command line args
>>>> are for the test run but I can't find it so far.
>>
>> The line above represent what I want to emulate within idle.
>> If you run idle, select File->Open; then select the program name
>> as above to open; select Debug->Debugger; then start the program
>> with F5... which is lovely but I cannot find a way to tell idle
>> what the args are.
>>
>> idle is really nice but I am stuck doing my debugging in pdb
>> because of this.
> 
> It's hard to believe, but AFAIK, there is no way to set the program 
> arguments from inside IDLE (and I'd love to be proven wrong!).
> 
> You have to set sys.argv by code in your main entry point:
> 
> sys.argv[1:] = ["--strict", "--debug", "file.dat"]
> or
> sys.argv[1:] = "--strict --debug file.dat".split()
> 
I did have a look at the source code once to find out how to add it;
perhaps I should have another go...



More information about the Python-list mailing list