Python mode tab loading issue

Hello.
I have a very simple sketch with 2 tabs.

When i try to load a function from the second tab into my main tab it gives me:

NameError: global name ‘scene1’ is not defined

I tried debugging by making the codes as basic as possible, renaming the two tabs, and it still gives this error.

tried the same code translated in java and everything worked fine. Is this a known issue? Are there any fixes? Is there something i don’t know?

I work in processing 3.5.4 (because the newer version had other issues with python mode)

Thanks a lot

1 Like
1 Like

On Python mode the tabs are like distinct modules, you need to import the names from them, it is not like on Java mode that the tabs behave like a single sketch.
It should be something like this:

Main sketch window:

from scenes import scene1, s

def setup():
    print(s)
    scene1()

scenes.py tab

s = 10

def scene1():
    pass
1 Like