import compileall compileall.compile_dir('/mnt/storage/workspace/med-ubuntu-free/build/ExtProjs/VTK/Wrapping/Python') file = open('/mnt/storage/workspace/med-ubuntu-free/build/ExtProjs/VTK/Wrapping/Python/vtk_compile_complete', 'w') file.write('Done')