Script Console: Run vs. Run as Console

Previous topic - Next topic

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:
try:
    from scribus import *
except ImportError:
    print "This script only runs from within Scribus."
    sys.exit(1)

print("test")


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? 
John L. Poole

work: Principal Software Engineer, Oracle Corporation
play: Editions Poole - publisher of classical ensemble piano music (using InDesign & scripts thereunder)

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