[Tutor] Finding the version # of a module, and py module problem

Richard D. Moores rdmoores at gmail.com
Fri Aug 6 10:20:38 EDT 2010


On Thu, Aug 5, 2010 at 18:47, Philip Semanchuk <philip at semanchuk.com> wrote:
>
> it's just a question of whether or not
> the module in question exposes any kind of a version attribute. There's no
> standard, unfortunately. The most popular convention seems to be via an
> attribute called __version__, but I've also seen __VERSION__, VERSION, and
> version.
>
Here's one more way:
>>> import gmpy
>>> gmpy.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '__version__'
>>>
>>> gmpy.version()
'1.12'
>>>

Dick Moores



More information about the Python-list mailing list