SYNOPSIS
========
-cython_freeze module [...]
+cython_freeze [-o outfile] module [...]
DESCRIPTION
modules, but it requires another C source file to be created.
+OPTIONS
+=======
+
+-o FILE, --outfile=FILE write output to FILE instead of standard output
+
+
EXAMPLE
=======
import optparse
-usage= '%prog module [module ...]'
+usage= '%prog [-o outfile] module [module ...]'
description = 'Create a C file for embedding Cython modules.'
p = optparse.OptionParser(usage=usage, description=description)
+p.add_option('-o', '--output', metavar='FILE',
+ help='write output to FILE instead of standard output')
options, args = p.parse_args()
p.print_help()
p.exit(1)
+if options.output:
+ import sys
+ old_stdout = sys.stdout
+ sys.stdout = open(options.output, 'w')
+
def format_modname(name):
if name.endswith('.pyx'):
name = name[:-4]