What you can do is to parse the output of a Python command as shell commands, by using the shell's Command Substitution functionality, which is more often used to evaluate a command in-line of another command. E.g. chown `id -u` /somedir
.
In your case, you need to print shell commands to stdout, which will be evaluated by the shell. Create your Python script and add:
testing = 'changed'
print 'export TESTING={testing}'.format(testing=testing)
then from your shell:
$ `python my_python.sh`
$ echo TESTING
changed
Basically, any string will be interpreted by the shell, even ls
, rm
etc