a question about the #prefix of sys.argv

Aldarion ErendisAldarion at gmail.com
Mon Jun 2 01:54:41 CEST 2008

for the little script
import sys
for k,v in enumerate(sys.argv):
    print k,v

it ignores  the part after # on linux
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