How to stop Python Script configuration window from running code automatically?

Hello everyone,

I like the updated Python script node (KNIME v5.2) a lot. However, they do run my code automatically whenever I open the node configuration windows - which I do not want.

Every time I open the configuration, my log files (which I have Python print for troubleshooting) get overwritten. I don’t think that that was the case in previous versions.

How can I switch this functionality off?

Many thanks!

Hi @kermitthefrog01,

Glad that you like the new Python Script node!

I am a little surprised by your report. The new dialog should be less eager to connect to a Python session than the old dialog. It only opens a Python session when one of the “Run” buttons is clicked: GitHub - PythonScriptingService.java.

However, there is other stuff happening in the background:

  • Python processes are started in a queue such that they are on hand when they are needed (this does not happen when the dialog is opened but happens every time a process from the queue is used).
  • When the dialog is opened, the " Python LSP Server" is started to provide language features for the editor.

How does your “print to log file” setup work? Could the issue be caused by one of the things described above?

2 Likes

Hi @bwilhelm,

thanks for your reply, you were correct.
I tried to recreate the problem and failed at recreating it - it behaved as you said it should. :face_with_raised_eyebrow:

The configuration windows replayed the last Python output and it did NOT overwrite my log files.

My best guess at what happened before would be that maybe I got confused by the replay of the output and also checked log files in a wrong folder by accident?

Anyhow, we can close the topic. Thanks for your time! Your reply helped me re-assess the (non-)issue. At the least, I now know that the Python Script Node works as I would have expected it to work. :slightly_smiling_face:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.