Which OS are you using? I seem to recall that the "print" statements don't end up in the .cb files on a particular OS (perhaps Windows).
What I've done in the past is to print to another filehandle instead of stdout (and note that the file will be created on the supervisor):
job = {
'prototype': 'cmdline',
'name': 'python callback test',
'package': {
'cmdline': 'hostname',
},
'callbacks': [
{
'language': 'python',
'triggers': 'done-job-self',
'code': '''
try:
import sys
fh = open('c:/temp/err.txt', 'w')
fh.close()
fh = open('c:/temp/foo.txt', 'w')
fh.write('Hello from job id %s\\n' % qb.jobid())
fh.write('sys.version : %s\\n' % sys.version)
fh.write('sys.version info : %s\\n' % '.'.join([str(x) for x in sys.version_info]))
fh.write('sys.executable : %s\\n' % sys.executable)
fh.close()
except Exception, e:
fh = open('c:/temp/err.txt', 'w')
fh.write('Error from job id %s\\n' % qb.jobid())
fh.write('%s\\n' % e)
fh.close()
'''
}
]
}
print '%(id)s: %(name)s' % qb.submit(job)[0]