Scribus Forums

Scribus => Scripts and Plugins => Topic started by: jlpoole on June 13, 2012, 05:00:33 pm

Title: Script Console: Run vs. Run as Console
Post by: jlpoole on June 13, 2012, 05:00:33 pm
The Script Console menu has "Script" which contains two submenu items:

What is the difference between the two?

If I have a script:
Code: [Select]
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? 
Title: Re: Script Console: Run vs. Run as Console
Post by: a.l.e on June 14, 2012, 05:51:17 pm
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