I have a situation where I want to get the version of an egg that's
installed.  I figured out the following, but wanted to know if I'm
missing something obvious that's easier::

  >>> import pkg_resources
  >>> p = pkg_resources.get_provider("cctagutils")
  >>> for line in p.get_metadata_lines("PKG-INFO"):
  ...    if line.find('Version: ') == 0:
  ...      version = line.split()[-1]

Thanks,

Nathan
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to