I have this code, the jogo==1 and jogo==2 options work fine and open what I want but the rest of the options dont open the .py files, is anything wrong with my code?
import runpy
def menuPrincipal():
print("\nMenu\n")
print("1 - Jogo do Galo")
print("2 - 4 em linha")
print("3 - Jogo da gloria")
print("4 - Jogo da força")
print("5 - Jogo Minas")
print("6 - Sair")
while True:
menuPrincipal()
jogo = int(input("Escolha um jogo: "))
if jogo == 1:
runpy.run_path(path_name='jogoDoGalo.py')
elif jogo == 2:
runpy.run_path(path_name='jogo4emLinha.py')
elif jogo == 3:
runpy.run_path(path_name='jogoDaGloria.py')
elif jogo == 4:
runpy.run_path(path_name='jogoDaForca.py')
elif jogo == 5:
runpy.run_path(path_name='jogoMinas.py')
elif jogo == 6:
break