Scribusoid

Author Topic: Script Console: Run vs. Run as Console  (Read 1459 times)

jlpoole

  • Newbie
  • *
  • Posts: 26
  • Karma: 0
  • Scribus User
Script Console: Run vs. Run as Console
« on: June 13, 2012, 05:00:33 pm »
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: [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? 
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1441
  • Karma: 19
    • the graphics lab
Re: Script Console: Run vs. Run as Console
« Reply #1 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

 

palmate