def compile_and_show(src_file): try: result = compile(src_file, c_only = 1) if result.c_file: bbedit_open(result.c_file) if result.h_file: bbedit_open(result.h_file) if result.i_file: bbedit_open(result.i_file) if result.listing_file and result.num_errors > 0: bbedit_open(result.listing_file) except IOError, e: print e
def compile_and_show(src_file): try: result = compile(src_file, c_only=1) if result.c_file: bbedit_open(result.c_file) if result.h_file: bbedit_open(result.h_file) if result.i_file: bbedit_open(result.i_file) if result.listing_file and result.num_errors > 0: bbedit_open(result.listing_file) except IOError, e: print e
from distutils.core import setup, Extension if __name__ == '__main__': from Pyrex.Compiler.Main import compile, default_options for pyrex_source in ['Lib/Point.pyx', 'Shapes/Ellipse.pyx']: print "Compiling", pyrex_source compile(pyrex_source, default_options) setup(ext_modules=[Extension("Lib.Point", ["Lib/Point.c"]), Extension("Shapes.Ellipse", ["Shapes/Ellipse.c"])])
def pyrex_compile(self, source): options = CompilationOptions(default_options, include_path = self.include_dirs) result = compile(source, options) if result.num_errors <> 0: sys.exit(1)