Scribus > Scripts and Plugins

Script Console: Run vs. Run as Console

(1/1)

jlpoole:
The Script Console menu has "Script" which contains two submenu items:

* Run F9
* Run as Console Ctrl+F9
What is the difference between the two?

If I have a script:

--- Code: ---try:
    from scribus import *
except ImportError:
    print "This script only runs from within Scribus."
    sys.exit(1)

print("test")
--- End code ---

Clicking "Run" produces "test" in the console -- the expected behavior.

Clicking "Run in Console" seems to cut from the editor and paste into the console the entire program and then the result.  What is the benefit of this approach? 

a.l.e:
hi jlpoole,

the difference is in the way the code is interpreted by python.

indeed, F9 runs the script as a whole and ctrl+F9 runs it line by line, as you were typing it in the console... just as you noticed.

i guess that the second behavior may be interesting when debugging some new code...
personally, i've never used it...

ciao
a.l.e

Navigation

[0] Message Index

Go to full version