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.
Related videos on Youtube
Comments
-
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__
-
jonrsharpe over 8 yearsHave you tried using
dir
to see if there are any attributes that might be it?
-
-
D Adams over 8 yearsPerhaps .version is another thing to try on arbitrary packages ??
-
D Adams over 8 years.version also seems to work on python's
pp
module -
D Adams over 8 yearsI don't have the reputation to add this knowledge to the main thread: stackoverflow.com/questions/20180543/…
-
D Adams over 8 yearsIs this specific to python tornado -> or should we be trying these properties on other packages which don't have .__version__ ??
-
Ben Darnell over 8 yearsThere's no standard about this, so it's worth a try on other packages.
version
andversion_info
are the names used in thesys
module, and I know thatpycurl
uses the same names (although in pycurlversion_info
is a function instead of an attribute)