“os.execl” Kode Jawaban

os.execl (sys.executable, sys.executable, *sys.argv)

import os
import sys

restart = input("\nDo you want to restart the program? [y/n] > ")

if restart == "y":
    os.execl(sys.executable, os.path.abspath(__file__), *sys.argv) 
else:
    print("\nThe program will be closed...")
    sys.exit(0)
TheProgrammer

os.execl

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)
futurelucas4502

Jawaban yang mirip dengan “os.execl”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya