Export a Python script and import in a new workflow

Hi
I made a PyScript in Knime and I would like to export it because I need it in another Workflow. There’s a way to do that and implement it as an external module like a normal plot, column reader,… or do I have to make it new every time?
Thanks

Hi there @GiulioFerrari,

you placed your topic in KNIME Development which is intended for KNIME node development. Does this mean you developed node regarding Python or you wrote python code in one of KNIME existing nodes?

Br,
Ivan

Hi @GiulioFerrari,

take a look at this blogpost: https://www.knime.com/blog/knime-and-jupyter on how to use re-use code from jupyter notebooks. This is ideal if you want to share funtions you use in different scripts.

Also, you can make use of the Templates tab in the Python dialog, you can save your current editor content as a template and use that in other python nodes of the same type.

best,
Gabriel

4 Likes

The blog gives a lot of information. I have a very small example among other things in this repository

image

The Jupyter notebook is in a subfolder called /script/ and the cells tagged as “export” will be used.

4 Likes