📜  os.execl - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:47.736000             🧑  作者: Mango

代码示例2
import os
import sys

if(input("Would you like to restart?\n") == "y"):
    os.execl(sys.executable, 'python', '"{}"'.format(__file__), *sys.argv[1:])
else:
    exit(0)