There's another easy way, you can type in terminal
sudo apt-get install python-opencv
Install OpenCV-Python in Ubuntu
After installing it, you can use opencv version 2.4 in both c++ and python.
But I recommend you should use opencv 3.2.0 and opencv-contrib, it gives more features
Hope this can help!