Hi there.
I have a rather basic question I suppose, although I can't seem to find an easy answer among the though rather thorough online information.
Say I create a file MyLib.py containing the following utility definition (for debugging purpose):
Code:
from reaper_python import *
def dbg(m):
RPR_ShowConsoleMsg("%s: %s" %(m, eval(m)))
RPR_ShowConsoleMsg("\n")
If I then create another py file and call this function, then the eval is failing:
Code:
import MyLib
foo = 123
MyLib.dbg("foo")
Then I get the following error:
Code:
NameError: name 'foo' is not defined
If I define the dbg function in the py file that uses it, it works.
It's like the scope of foo is wrong when dbg is in another py file.
I am sure this is basic stuff but couldn't really find out a solution for the time I could dedicate to it...
Thanks for your help.