When Leo is run in direct mode, i.e. not from a console, print statements in a python script can not be seen. Below is work around -- LeoTabPrint? -- that redirects print statements to a tab pane.

In addition, you may find it convenient to use LeoTabPrint? to place script output in a dedicated Leo pane and use simple python print statements to show output as an alternative to g.es().

Using a class defined as:

class LeoTabPrint:
    Simple class with a write method that will send print to a named LeoTab Pane
    Use with sys.stdout to redirect as so:
          foo = LeoTabPrint(tWindow)
          sys.stdout = foo
          print "Tab print test

    def __init__(self,tab,clear=None):
        if clear:
    def write(self, string):

The code uses LeoTabPrint? to redirect all print statements to the new tab:

# Redirection of stdout
import sys
tWindow= 'Test Pane'
foo = LeoTabPrint(tWindow,clear=True)
sys.stdout = foo
print "Tab print test"

Note that you can give the new tab window name you desire and clear=True clears an existing tab pane withe same name. Clearing a dedicated tab makes it easy to check a specific scripts output, especially compared to using g.redirectStdout() that redirects stdout to the current log pane.