
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/no_output/plot_syntaxerror.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_auto_examples_no_output_plot_syntaxerror.py>`
        to download the full example code or to run this example in your browser via Binder.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_no_output_plot_syntaxerror.py:


SyntaxError
===========

Example script with invalid Python syntax

.. GENERATED FROM PYTHON SOURCE LINES 1-13


.. rst-class:: sphx-glr-script-out

.. code-block:: pytb

    Traceback (most recent call last):
      File "examples/no_output/plot_syntaxerror.py", line 12
        Invalid Python code
                ^^^^^^
    SyntaxError: invalid syntax






|

.. code-block:: Python

    """
    Example with SyntaxError
    ========================

    Sphinx-Gallery uses Python's AST parser, thus you need to have written
    valid python code for Sphinx-Gallery to parse it. If your script has a
    SyntaxError you'll be presented the traceback and the original code.
    """
    # Code source: Óscar Nájera
    # License: BSD 3 clause

    Invalid Python code


.. _sphx_glr_download_auto_examples_no_output_plot_syntaxerror.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: binder-badge

      .. image:: images/binder_badge_logo.svg
        :target: https://mybinder.org/v2/gh/sphinx-gallery/sphinx-gallery.github.io/master?urlpath=lab/tree/notebooks/auto_examples/no_output/plot_syntaxerror.ipynb
        :alt: Launch binder
        :width: 150 px

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_syntaxerror.ipynb <plot_syntaxerror.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_syntaxerror.py <plot_syntaxerror.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: plot_syntaxerror.zip <plot_syntaxerror.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
