sys.argv is munging my command line options

Ant antroy at
Wed Aug 29 21:28:00 CEST 2007

On Aug 29, 8:11 pm, Chris Allen < at> wrote:
> But I'm running into a problem with this which is that sys.argv splits
> my key=value options.  I need to know the option associations, and
> there's no way to know this by inspecting sys.argv.  Can I get access
> to the command line string as python saw it before it split it into
> sys.argv or is there another way?  Thanks.

Could you show us some example code that demonstrates this? The
following works as expected for me on win32:

import sys

for arg in sys.argv[1:]:
	print arg

>From the command prompt:

C:\0> action key=value key=value


More information about the Python-list mailing list