Skip to content

Commit 622bc48

Browse files
authored
Merge pull request #3630 from markotoplak/script-run-shortcut
OWPythonScript: run shortcut (Ctrl/Cmd + R)
2 parents e2dd103 + eb4a1de commit 622bc48

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Orange/widgets/data/owpythonscript.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,10 @@ def __init__(self):
517517

518518
self.execute_button = gui.button(self.controlArea, self, 'Run', callback=self.commit)
519519

520+
run = QAction("Run script", self, triggered=self.commit,
521+
shortcut=QKeySequence(Qt.ControlModifier | Qt.Key_R))
522+
self.addAction(run)
523+
520524
self.splitCanvas = QSplitter(Qt.Vertical, self.mainArea)
521525
self.mainArea.layout().addWidget(self.splitCanvas)
522526

doc/visual-programming/source/widgets/data/pythonscript.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Note: You should not modify the input objects in place.
3434
![](images/PythonScript-stamped.png)
3535

3636
1. Info box contains names of basic operators for Orange Python script.
37-
2. The *Library* control can be used to manage multiple scripts. Pressing "+" will add a new entry and open it in the *Python script* editor. When the script is modified, its entry in the *Library* will change to indicate it has unsaved changes. Pressing *Update* will save the script (keyboard shortcut ctrl + s). A script can be removed by selecting it and pressing the "-" button.
38-
3. Pressing *Execute* in the *Run* box executes the script (using ``exec``). Any script output (from ``print``) is captured and displayed in the *Console* below the script. If *Auto execute* is checked, the script is run any time inputs to the widget change.
37+
2. The *Library* control can be used to manage multiple scripts. Pressing "+" will add a new entry and open it in the *Python script* editor. When the script is modified, its entry in the *Library* will change to indicate it has unsaved changes. Pressing *Update* will save the script (keyboard shortcut "Ctrl+S"). A script can be removed by selecting it and pressing the "-" button.
38+
3. Pressing *Execute* in the *Run* box executes the script (keyboard shortcut "Ctrl+R"). Any script output (from ``print``) is captured and displayed in the *Console* below the script.
3939
4. The *Python script* editor on the left can be used to edit a script (it supports some rudimentary syntax highlighting).
4040
5. Console displays the output of the script.
4141

0 commit comments

Comments
 (0)