PyInstaller
通过如下命令安装PyInstaller
pip install PyInstaller
如果PyInstaller是3.2版本的,打包后的exe,执行会报如下错误:
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the application's support team for more information.
通过如下命令升级至3.3即可解决:
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
最终通过PyInstaller插件把Python转化为exe可执行文件
PyInstaller -F -w C:\Users\joy\PycharmProjects\demo\main.py
-F 生成单一exe文件 -w 取消命令行窗口的显示
调用语音
通过如下命令可以将文字转化为语音:
os.system('mshta vbscript:createobject("sapi.spvoice").speak("%s")(window.close)' % "hello")