Any way to loop through object variables?

Dave Challis dsc at ecs.soton.ac.uk
Wed May 28 11:29:11 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
Just wondering if there's a way to iterate through all variables which
an object has set?

Specifically, I'm using the OptionParser module, which returns an
options object, containing all command line options as object variables.
 I'd like to iterate over these rather than getting at them by name.

Cheers,
Dave
- --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                            __/|_
 ><>                                       / o   \/|
      Dave Challis           )><>          \_____/\|
____dsc at ecs.soton.ac.uk______(____________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIPXpHv26GZvAVVFERAmkaAKDUJuGk8L2nJf8B9b1RaMYpVr9bCwCaAubM
TWdK4AmzAgpKNQxZK3AOB4Q=
=6STh
-----END PGP SIGNATURE-----



More information about the Python-list mailing list