with open('main.c', 'w') as main:
    main.write(ccode)
compiler = MSVCCompiler()
compiler.compile(['main.c'], include_dirs=['C:/Python27/include'])
How to compile simple python embeded program using distutils