[Tutor] os.execl() args?
Tadahiko 'kiko' Uehara
kikofx@nifty.com
Sun May 11 02:14:02 2003
Thank you for replying, David!
In my enviroment (Linux,tcsh,python2.2), I don't see path name.. :(
###
jem:/home/kiko/docs/python> python args.py lots of arguments here
Args were:
args.py
lots
of
arguments
here
###
Basically, My understand for arguments are (optional) parameters which passed to command.
ie. 'xv foo.png' (xv is command and foo.png is an argument)
execl('xv','','foo.png')
or 'mv -r foo foo2' (mv for command, -r , foo , foo2 are arguments)
Is this correct?
Thanks in advance,
-kiko
On Sat, 10 May 2003 15:45:53 -0400
"David Broadwell" <dbroadwell@mindspring.com> wrote:
> <questioner wrote>
> 2) os.execl(render,'',queue) , I had to give arg0 blank. I found the
> following explanation in the doc...
>
> "For the C programmer, this is the argv[0] passed to a program's main(). For
> example, "os.execv('/bin/echo', ['foo', 'bar'])" will only print "bar" on
> standard output; "foo"will seem to be ignored."
>
> I'm not quite sure what it says.. Though, give argv0 to nothing'' is
> correct?
>
>
> Well, I'm green to, so I'll answer with code.
>
> <file: args.py>
> from sys import argv
>
> print "Args were:"
> for item in argv:
> print item
> </file: args.py>
>
> $p$g > args.py lots of arguments here
> Args were:
> D:\mongoose\My Documents\My Code\python\args.py
> lots
> of
> arguments
> here
>
> ---
>
> sys.argv[0] is the path to the script ... And it's interesting to note that
> if you "" a block of args they end up as one arg.
>
> Sorry, can't really answer the rest.
>
> --
>
> David Broadwell (Amar Shadowpaws)
>