Browsing Wiremod's section
← Back to ACE
💬

Community answer

Collected from the ACE community Discord archive around 2022-07-03. It may be informal or outdated — anyone can edit this page to improve it. Original discussion

Detecting if a file is the chip's main script

💻 Expression 2Updated 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.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.