a question about the #prefix of sys.argv

John Machin sjmachin at lexicon.net
Mon Jun 2 02:12:40 CEST 2008


On Jun 2, 9:54 am, Aldarion <ErendisAldar... at gmail.com> wrote:
> for the little script
> #egg.py
> import sys
> for k,v in enumerate(sys.argv):
>     print k,v
>
> it ignores  the part after # on linux

Perhaps "it" is the linux shell ...

> below is the running output on windows and linux. no clue here.
> D:\python\note>egg.py #test
> 0 D:\python\note\egg.py
> 1 #test
>
> D:\python\note>egg.py for bar #spam egg
> 0 D:\python\note\egg.py
> 1 for
> 2 bar
> 3 #spam
> 4 egg
> ddd at bbb:~/transfer$ python2.5 egg.py #test
> 0 egg.py
> ddd at bbb:~/transfer$ python2.5 egg.py foo bar #spam egg
> 0 egg.py
> 1 foo
> 2 bar






More information about the Python-list mailing list