Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/nbconvert/exporters/python.py: 80%

10 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1"""Python script Exporter class""" 

2 

3# Copyright (c) Jupyter Development Team. 

4# Distributed under the terms of the Modified BSD License. 

5 

6from traitlets import default 

7 

8from .templateexporter import TemplateExporter 

9 

10 

11class PythonExporter(TemplateExporter): 

12 """ 

13 Exports a Python code file. 

14 Note that the file produced will have a shebang of '#!/usr/bin/env python' 

15 regardless of the actual python version used in the notebook. 

16 """ 

17 

18 @default("file_extension") 

19 def _file_extension_default(self): 

20 return ".py" 

21 

22 @default("template_name") 

23 def _template_name_default(self): 

24 return "python" 

25 

26 output_mimetype = "text/x-python"