Detecting if a file is the chip's main script
💻 Expression 2•Updated 2 days ago•0 views
Not built in - workaround: assign a global var holding the filename of whichever file sets it first, using debug.getinfo to get the current file name.
Is there a built-in way (like Python's __name__ == '__main__') to know if a file is the main script vs an included library
Not built in - workaround: assign a global var holding the filename of whichever file sets it first, using debug.getinfo to get the current file name.