search

Home  >  Q&A  >  body text

terminal - python内打开another终端

import os
cmdline ='python publisher.py | python scheduler.py'
os.system(cmdline)

运行完上面的步骤,想要继续打开一个终端运行另一个python文件,怎么做呢?

PHP中文网PHP中文网2819 days ago459

reply all(1)I'll reply

  • 迷茫

    迷茫2017-04-18 09:05:29

    Refer to my previous answer https://segmentfault.com/q/1010000005915290/a-1020000005917042 which has a similar example

    The problem isos.system是阻塞的, 一定要上一步完成你才能做下一步
    建议改用subprocess

    reply
    0
  • Cancelreply