Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global utility functions (or alternatively ability to import other scripts) #210

Open
TheAssassin opened this issue Mar 1, 2024 · 0 comments

Comments

@TheAssassin
Copy link
Contributor

Many laser scripts used by the various labs or in VisiCut's examples contain similar if not the same code all over again. For instance, drawing figures or characters inspired by a seven segment display (which I find relatively limited and will soon extend to a 14 or 16 segment one), a simple but useful focus gauge to include in other scripts, etc.

I would like to be able to define those functions once and then import the functionality into other scripts, either from a global utility script exposing functions into the global namespace or by explicitly importing script files (the latter allowing users to maintain their own scripts while also allowing them to import a global one).

There are so many advantages of such a scenario: not only will the copy-pasta between scripts end which often causes inconsistencies. When going for the import feature, one could recycle functionality from a script in another one or add different "frontends", e.g., one asking prompts, the other one using some quick defaults.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant