python: write to (InteractiveConsole)

时间:2015-05-12 23:19:15

标签: python django

I have python script that creates django project and its apps then writes models files for apps.

This process needs to execute commands like

$i = 0;
$times_to_run = 16;
$hash = 'text';
while ($i++ < $times_to_run)
{
    $hash = md5($hash);
}

and this works fine.

The problem that I need then to write to os.system('python C:\TestProj\TestApp\manage.py migrate') for manipulating some lookup data in db. I tried Popen but it seems that I missing something.

So, How could I stdout the InteractiveConsole?

My python version: 3.4.3

My django version: 1.8.0

0 个答案:

没有答案