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

Python #519

Open
ColorMode opened this issue Apr 30, 2024 · 3 comments
Open

Python #519

ColorMode opened this issue Apr 30, 2024 · 3 comments

Comments

@ColorMode
Copy link

No description provided.

@h4zielh
Copy link

h4zielh commented Apr 30, 2024

?

@Blue4dave
Copy link

How to build a python block

@n00b0dyy
Copy link

Creating a block using Python is as simple as using a step-by-step guide. All you need to do is clearly define the purpose of building this block: what specific problem is it supposed to solve, and exactly what functionality should it provide?

Design the surface: Determine how the block will communicate with other sections of the script. What do you need for input? What is the result?

When constructing a function, declare it using the def keyword and provide the function name along with any parameters. Construct a function body that performs the desired action.

When constructing a class, use the keyword class and then provide the class name. Design the methods (functions inside the class) needed to perform the tasks of the block.

To test the functionality of the block under different conditions: Implement block testing by creating test cases to help confirm the expected behavior when using different inputs - this includes executing the block with different inputs and making sure the output is correct based on those inputs.

Review and improve, but don't stop there. Test results to check the effectiveness of changes or identify further modifications that may be necessary. Also recheck the code and repeat the testing process after refinement.

Finally, it would be worthwhile to take a look at the documentation. This document should clearly state the purpose of the block, the expected inputs and outputs, and examples demonstrating its use. By providing this information, you enable other developers to easily understand the functionality of your block and integrate it effectively into their work.

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

4 participants