python.py 533 B

1234567891011121314151617181920212223
  1. """Python script Exporter class"""
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. from traitlets import default
  5. from .templateexporter import TemplateExporter
  6. class PythonExporter(TemplateExporter):
  7. """
  8. Exports a Python code file.
  9. """
  10. @default('file_extension')
  11. def _file_extension_default(self):
  12. return '.py'
  13. @default('template_file')
  14. def _template_file_default(self):
  15. return 'python.tpl'
  16. output_mimetype = 'text/x-python'