Message241588
| Author |
MartyMacGyver |
| Recipients |
MartyMacGyver, ned.deily, serhiy.storchaka, steve.dower, terry.reedy, tim.golden, zach.ware |
| Date |
2015年04月20日.02:12:37 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1429495957.6.0.731059483504.issue23982@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
FYI, I'm currently using calls into Tkinter to get more detailed version info. Some methods work better than others... I've outlined my attempts below for reference (the last tcl_ver and tk_ver outputs are the ones I'm using, even though they are somewhat different in how they are written).
try: # Python2
import Tkinter as tk
except ImportError: # Python3
import tkinter as tk
root = tk.Tk()
tcl_ver = tk.TclVersion # Typical but low precsion
tcl_ver = tk.Tcl().eval('info patchlevel') # Works but uses eval()
tcl_ver = root.tcl.call('info', 'patchlevel') # Fails (AttributeError)
tcl_ver = tk.Tcl().call('info', 'patchlevel') # Works, using
tk_ver = tk.TkVersion # Typical but low precsion
tk_ver = tk.Tk().eval('info patchlevel') # Works but makes extra window, uses eval()
tk_ver = tk.Tk().call('info', 'patchlevel') # Works but makes extra window
tk_ver = root.tk.call('info', 'patchlevel') # Works, using |
|