How would I execute my game script using my menu script with the IF statement? I've been searching all over the internet for the answer, but most of the answers I've seen have been quite confusing to me.
import pygame
import dumbmenu as dm
pygame.init()
from subprocess import Popen, PIPE
# Variables
red = 255, 0, 0
green = 0,255, 0
blue = 0, 0,255
size = width, height = 340,240
screen = pygame.display.set_mode(size)
screen.fill(blue)
pygame.display.update()
pygame.key.set_repeat(500,30)
choose = dm.dumbmenu(screen, [
'Start Game',
'Quit Game'], 64,64,None,32,1.4,green,red)
if choose == 0:
subpprocess = Popen(['swfdump', 'main.py', '-d'], stdout=PIPE)
stdout, stderr = process.communicate()
elif choose == 1:
pygame.quit()
exit()