import os, shutil builddir = "build" if(not os.path.isdir(builddir)) : os.mkdir(builddir) command = "cd " + builddir + "; cmake ../src; make -j2 install" os.system(command)