Get Python Tornado Version?

13,545

Solution 1

Tornado has both tornado.version, which is a string for human consumption (currently "4.2"), and tornado.version_info, which is a numeric tuple that is better for programmatic comparisons (currently (4, 2, 0, 0)). The fourth value of version_info will be negative for betas and other pre-releases.

Solution 2

With no reference, or reason I tried the following:

print tornado.version

which seems to do the trick.

Share:
13,545

Related videos on Youtube

D Adams
Author by

D Adams

Interests: Mathematics, Physics, Machine Learning

Updated on October 10, 2022

Comments

  • D Adams
    D Adams about 1 year

    How do I get the current version of my python Tornado Module Version?

    With other packages I can do the following:

    print <modulename>.__version__
    

    Source: How to check version of python modules?

    • jonrsharpe
      jonrsharpe over 8 years
      Have you tried using dir to see if there are any attributes that might be it?
  • D Adams
    D Adams over 8 years
    Perhaps .version is another thing to try on arbitrary packages ??
  • D Adams
    D Adams over 8 years
    .version also seems to work on python's pp module
  • D Adams
    D Adams over 8 years
    I don't have the reputation to add this knowledge to the main thread: stackoverflow.com/questions/20180543/…
  • D Adams
    D Adams over 8 years
    Is this specific to python tornado -> or should we be trying these properties on other packages which don't have .__version__ ??
  • Ben Darnell
    Ben Darnell over 8 years
    There's no standard about this, so it's worth a try on other packages. version and version_info are the names used in the sys module, and I know that pycurl uses the same names (although in pycurl version_info is a function instead of an attribute)