0
他のプログラム(私が前に作ったゲーム)を開き、ウィンドウが即座に閉じるプログラムを作ろうとしています。'ゲーム'をインポートしてウィンドウを閉じる
#Program that runs game i have made
import subprocess
choice = input("What would you like to do? \nGuess my number game (1) \nCalorie counter (2) \nWord jumble game (3) \nInsert your decision here - ")
while choice == "1":
print("Let us begin")
def start_guess_my_number():
subprocess.call(['python', 'Guess my number game2.py'])
start_guess_my_number()
choice = input("What would you like to do now? 1 2 or 3 ? - ")
while choice == "2":
print("Let us begin")
def start_calorie_counter():
subprocess.call(['python', 'Calorie counter.py'])
start_calorie_counter()
choice = input("What would you like to do now? 1 2 or 3 ? - ")
while choice == "3":
print("Let us begin")
def start_guess_my_number():
subprocess.call(['python', 'Word jumble game.py'])
start_guess_my_number()
choice = input("What would you like to do now? 1 2 or 3 ? - ")
input("Press enter to exit")
注:私は、私は呼びかけていたプログラムが動作していることを確認してきた、と黒のコマンドウィンドウで開いたときに、彼らは私がこのプログラムを経由して、それらを開いたときとは違って、開いたまま。
端末を使用してプログラム(python app.py)を実行すると、出力が表示されることがあります –