On Jun 2, 8:50 am, Aldarion <[EMAIL PROTECTED]> wrote:
> On 6月2日, 上午8时05分, Peter Otten <[EMAIL PROTECTED]> wrote:
>
> > Aldarion 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
> > > below is the running output on windows and linux. no clue here.
>
> > This has nothing to do with python, it's the shell that treats the # and
> > everything that follows as a comment.
>
> > $ ./listargs.py alpha #beta
> > 0 ./listargs.py
> > 1 alpha
>
> > But you can escape it:
>
> > $ ./listargs.py alpha \#beta
> > 0 ./listargs.py
> > 1 alpha
> > 2 #beta
>
> > $ ./listargs.py alpha '#beta'
> > 0 ./listargs.py
> > 1 alpha
> > 2 #beta
>
> > Peter
>
> thanks everyone for the quickly reply, i see now.

Thank you Aldarion for your post.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to