start_main.py 511 B

1234567891011121314151617181920212223
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2023/9/21
  4. import subprocess
  5. import time
  6. def start_main():
  7. # 启动 start_mitmproxy.py 脚本的子进程
  8. mitmproxy_process = subprocess.Popen(['python', 'start_mitmproxy.py'])
  9. # 等待 mitmproxy 启动
  10. time.sleep(2)
  11. # 启动 start_selenium.py 脚本的子进程
  12. selenium_process = subprocess.Popen(['python', 'start_selenium.py'])
  13. # 等待子进程完成
  14. mitmproxy_process.wait()
  15. selenium_process.wait()
  16. start_main()