nir / jupylet

Python game programming in Jupyter notebooks.
https://jupylet.readthedocs.io
BSD 2-Clause "Simplified" License
230 stars 22 forks source link

No error message if jupylet is used in a helper file #30

Open quantumjim opened 3 years ago

quantumjim commented 3 years ago

For example, suppose you have a file game.py with

from jupylet.label import Label as Label
from jupylet.app import App as App

app = App(width=320, height=64)

sitting next to a notebook in which you have

import game

hello = game.Label('hello, world', color='cyan', font_size=32, x=game.app.width, y=16)

@game.app.run_me_every(1/30)
def scroll(ct, dt):
    hello.x = hello.x - 1

    if hello.right < 0:
        hello.x = app.width

@game.app.event
def render(ct, dt):
    game.app.window.clear()
    hello.draw()

game.app.run()

This all runs fine. However, if syntax errors are introduced into scroll and render, no error message will appear.