ecmwf / metview-python

Python interface to Metview meteorological workstation and batch system
https://metview.readthedocs.io/en/latest/
Apache License 2.0
127 stars 32 forks source link

Execute Python scripts with left click #17

Closed gkafk closed 3 years ago

gkafk commented 3 years ago

image

Is it possible to save commands in icons that run Python scripts or macros with a double click, much like the Shell Script Icon, but without requiring from user to open it with the editor and run it ( F9 ) ? So that the user will open the grib file of each folder with one click of the command icon and will have many products ready, easy and fast, even if the grib files are replaced by newer ones.

It would be much better if commands for products could saved in user interface toolbar

image

iainrussell commented 3 years ago

Hi, if I understand your question correctly, if you have Macro or Python scripts, you can right-click on those icons and select 'execute' to run them. If this sounds like what you want to do, let me know if you need help creating Macro or Python icon. Cheers!

gkafk commented 3 years ago

Hi, thank you for your quick reply.

Now it works with right click, opens the CodeEditor and starts the process of the python script by clicking the green run button or keyboard F9. But this is not what I want. I would like to run scripts just with double or simple left click. Is it possible in metview?

iainrussell commented 3 years ago

Hi, the quickest way possible is to right-click/execute. Double-click is assigned to 'edit' and cannot be customised. Do you at least see the 'execute' item in the context menu when you right-click? image

gkafk commented 3 years ago

Yes, I see it and works fine in this way. If I could assign double-click to 'Execute' would be nice.