2

I want to use C ++ to confirm local windows system python version installed, I do not know How to determine?

2
  • 1
    What do you want to happen in the event that multiple python versions are installed? Commented Apr 22, 2016 at 2:08
  • Thanks for attention, if I can get them all, that will be best. Commented Apr 22, 2016 at 3:10

1 Answer 1

2

If the python directory has been added to the PATH environment variable, you can easily _popen python with the --version argument, and parse out the version number from the standard output (which will be e.g. Python 2.7.6).

Another option would be to use regedit to see if the version appears somewhere in the registry that you can read it from. Lots of existing S.O. Q&A on how to read registry values....

If you get stuck implementing either option, post your code and the specific problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.