如何将help.chm文件合并到python应用程序中?

如何将help.chm文件合并到python应用程序中?,python,python-2.7,Python,Python 2.7,我正在使用python2.7.12,我想知道如何将*.chm文件添加到python脚本中,以便在按下F12按钮时正确启动它? 以下是我到目前为止的情况: def hchma(): webbrowser.open_new(r"file://C:\WINDOWS\ULIX TxT Editor\Resources\helpCenter\helpCentre11.chm") def hchm(event): webbrowser.open_new(r"file://C:\WINDOW

我正在使用python2.7.12,我想知道如何将*.chm文件添加到python脚本中,以便在按下
F12
按钮时正确启动它? 以下是我到目前为止的情况:

def hchma():
    webbrowser.open_new(r"file://C:\WINDOWS\ULIX TxT Editor\Resources\helpCenter\helpCentre11.chm")

def hchm(event):
    webbrowser.open_new(r"file://C:\WINDOWS\ULIX TxT Editor\Resources\helpCenter\helpCentre11.chm")
但是,当我在Win10以外的任何Windows操作系统上运行此代码时,它将打开一个web_浏览器,而不是文件本身。不过,这段代码在Windows 10上运行得很好。 这是我的根绑定标签

root.bind('<F12>', hchm)
root.bind(“”,hchm)

您可以改用子流程,使其直接打开

subprocess.Popen('hh.exe "C:\WINDOWS\ULIX TxT Editor\Resources\helpCenter\helpCentre11.chm"')