You could use a subprocess shell to send commands that need CLI interaction:
This example creates a upm profile named 'test':
import subprocess
p = subprocess.Popen(['/exos/bin/exsh','-n0', '-b', '-e','remote_serial'],
stdin = subprocess.PIPE,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
print >> p.stdin, 'create upm profile test'
print >> p.stdin, '.'