Neat way to get rid of [" "] in sys.argv[n:] returns

korean_dave davidreynon at
Thu Jul 24 22:48:46 CEST 2008

so, i code this:

import sys
import os

for param in os.environ.keys():
    print "%20s %s" % (param,os.environ[param])


and then when i type in -->

python "testparameter"

I get this output:


Is there a way to neatly, in one call to the parameter, to get rid of
the [' and '] without bothering to replace() '[ with "" and replace()
'] with ''?


More information about the Python-list mailing list