Access to raw command line?

Laurent Pointal laurent.pointal at limsi.fr
Thu Apr 26 09:13:29 CEST 2007


Pieter Edelman a écrit :
<zip>
> One possible way to work around this is to get the raw command line
> and do the shell expansions ourselves from within Python. Ignoring the
> question of whether it is worth the trouble, does anybody know if it
> is possible to obtain the raw (unexpanded) command line?
> Alternatively,  does anybody have suggestion of how to do this in a
> clean way?

To avoid shell extension, try to quote args:
./myprog.py -t "*.gpx" "*.jpg"


Or (IMHO simpler) define anoter switch to identify other files:
./myprog.py -t *.gpx -u *.jpg

A+

Laurent.



More information about the Python-list mailing list