Demo extension with Python code


Overview
A simple extension example demonstrating how to link custom Python code to a ribbon icon in HyperMesh. Upon clicking the icon, a message will be printed in the IPython console.
Usage/Installation Instructions
1. Unzip the DemoExtensionWithPython.zip
2. Register the extension - File > Extensions and click Add Extension in the Extension Manager dialog
Comments
-
Hello Michal,
Thanks for sharing.When I tried to adapt the example to our environment, I encountered an issue. I received the following error:
TypeError: myFunc() got an unexpected keyword argument 'charmap'
The solution was to modify the function definition to include
*args
and**kwargs
:def myFunc(): ⇒ def myFunc(*args, **kwargs):
I hope this helps anyone else facing a similar issue.
1 -
Thank you for adding your comment. You are absolutely right - the functions are internally passed some arguments which they need to be able to "consume".
FYI We will make sure to include this information in the future documentation updates and in the training package that is currently being worked on.
Best regards,
Michal1