windows-7 - 怎样用 c++ 判断 windows 系统中 python的版本?
巴扎黑
巴扎黑 2017-04-17 17:37:48
0
2
536

怎样判断本地安装的 python 的版本? 通过注册表是否可以?

巴扎黑
巴扎黑

reply all(2)
巴扎黑

A tricky way is to execute the system command in c++, and then read the python version information from the out.txt file: out.txt文件里去读python版本信息:

system("python --version 2> out.txt");

system("python --version 2> out.txt");🎜
PHPzhong

Yes, but it is possible (I am not sure whether python will write version information to the registry when installing) that it cannot be obtained, because many people have encountered this problem of failing to obtain the python version through the registry when installing software
Of course, you can also execute commands upstairs or through pipelines to obtain python information, but there is a requirement. The python you want to query must be set in the PATH environment variable

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template