首页 > 其他 > 详细

Process calling

时间:2020-12-24 00:58:09      阅读:35      评论:0      收藏:0      [点我收藏+]

code.py
import os
import sys
import time
 
program = "python3"
print("Process calling")
arguments = ["xxxxxx.py"]
 
os.execvp(program, (program,) + tuple(arguments))
print("Good Bye!!")
time.sleep(5)

xxxxxx.py

print("hahhaha")

 

 

 
python3 code.py
outputs
macname@MacdeMBP files % python3 test.py
Process calling
hahhaha
macname@MacdeMBP files % 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Process calling

原文:https://www.cnblogs.com/sea-stream/p/14181825.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!