keep all documents in same folder.
you can use any IDE for projects but phycharm is really helpful for python codes.
firstly you have to create your database with 'createdata' code after you run this code you will have 30 different picture for each ID
then you should go into 'traning' folder for create your .yml file, its gonna be your trained data
in the end you go into 'detection' folder and run it. 
THIS CODE ONLY WORK FOR FRONTAL FACE, but if you change the algorithm you can also use it for whole face too. just google it for find the right algorithm and instead of face.xml use that algorithm