<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nb_to_python(nb_path):
 """convert notebook to python script"""

    exporter = python.PythonExporter()
    output, resources = exporter.from_filename(nb_path)
    return output