Sandip Bhattacharya wrote:
On Nov 4, 12:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
def main(argv=None):
if argv is None: argv = sys.argv[1:]
...
Wouldn't that make optparse miss the first parameter sys.argv[1]
mistaking it to be the name of the current program?
Nope...opt
On Nov 4, 12:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> def main(argv=None):
> if argv is None: argv = sys.argv[1:]
> ...
Wouldn't that make optparse miss the first parameter sys.argv[1]
mistaking it to be the name of the current program?
- Sandip
--
http://mail.python.org/m
TP schrieb:
Hello,
I have a script that uses the "optparse" package to parse the command line.
For example:
$ script.py --help
# displays help about script.py
Is this possible to call such a script with execfile('') once in the Python
interactive shell?
execfile( 'script.py' )
I get errors
TP <[EMAIL PROTECTED]> writes:
> Hello,
>
> I have a script that uses the "optparse" package to parse the command line.
> For example:
>
> $ script.py --help
> # displays help about script.py
>
> Is this possible to call such a script with execfile('') once in the Python
> interactive shell?
>
>>>