The equivalent in python is to set the os.environ[] and then specifying the "export_environment" job submission flag.
python
>>> import os
>>> import qb
>>> os.environ['AAA'] = 'ABC'
>>> qb.submit(qb.Job({'prototype':'cmdline', 'package':{'cmdline':'set'}, 'flagsstring':'export_environment'}))
From the stdout for the job running "set" to display environment variables:
----------------------------------
- Worker 630.0
----------------------------------
[Mar 31, 2008 16:32:29] MyMachine : job type version:
loading command line executor.
job id: 630
COMMAND: set
AAA=ABC
...
There is an identified bug on exposing the environment data passed into a job via python. Until it is fixed, seeing the environment can currently be done at the by the commandline call "qbjobs --xml <jobid>" and looking at the <env> section.
Alternatively, one can inline the setting of the environment variables when specifying the command to run. For example, set the "command" for a commandline job to:
export ZZZ=4 && export ZZZZ=9 && set
We do note that there is room for improvement in this process and we will work on streamlining the explicit passing of environment variables as we move forward to better address our customer needs.