m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
383 B

6 months ago
  1. from sympy.printing.c import C99CodePrinter
  2. def render_as_source_file(content, Printer=C99CodePrinter, settings=None):
  3. """ Renders a C source file (with required #include statements) """
  4. printer = Printer(settings or {})
  5. code_str = printer.doprint(content)
  6. includes = '\n'.join(['#include <%s>' % h for h in printer.headers])
  7. return includes + '\n\n' + code_str