def dostata(dofile, *params):
    import subprocess
cmd = ['stata', 'do', dofile]
for param in params:
    cmd.append(param)
return subprocess.call(cmd)
dostata('/home/roberto/Desktop/pyexample3.do', 'mpg', 'weight', 'foreign')
Запустите файл Stata do из Python