Skip to content

Syntax Error When Running .py File in Jupyter/Colab #29

@kongranjia

Description

@kongranjia

I'm working through a context expansion tutorial and encountering a syntax error when trying to run the .py file in Jupyter/Colab.

When I execute:

%run 02_expand_context.py

I get this error:

SyntaxError: invalid decimal literal

The error points to line 79 in the file, which appears to contain explanatory text/markdown content rather than executable Python code.

Could you please clarify:

  1. What is the intended way to use this .py file?
  2. Should it be executed directly, or is it meant to be imported as a module?
  3. If it contains both code and documentation, how should I properly run the executable portions?

The file seems to be part of a tutorial series, but the presence of narrative text within a .py file is causing execution issues. Any guidance on the correct approach would be greatly appreciated.

Thank you!

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions