Q:

i have converted python program to an .exe file but on opening the .exe file i don't see an output, but just a empty cmd window

i have converted the python file to an exe file using the pyinstaller. The command i used is this "pyinstaller --onefile snake_game.py". i just an empty cmd window and it closes after few seconds =>. i have also tried to convert other python programs they work just fine but this one does not work. From my inspection the code is correct. 
import pygame
import time
import random

pygame.init()
pygame.mixer.init()

white = (255, 255, 255)
yellow = (255, 255, 102)
black = (0, 0, 0)
red = (213, 50, 80) 
green = (0, 255, 0)
blue = (50, 153, 213)
glow_blue = (115, 194, 251)

dis_width = 800 
dis_height = 600

FPS = 20
fpsClock = pygame.time.Clock()

dis = pygame.display.set_mode([dis_width,dis_height])
pygame.display.set_caption("Snake Game ")

snake_block = 20

score_font = pygame.font.SysFont("Algerian", 35)
finish_font = pygame.font.SysFont("copper", 55)

back_image = pygame.image.load(r"C:\Users\vicky\OneDrive\Desktop\ALL PYTHON\snake game final\back_ground2.jpg")

game_finish = pygame.image.load(r"C:\Users\vicky\OneDrive\Desktop\ALL PYTHON\snake game final\finish.jpg")

last_score = pygame.font.SysFont("Algerian", 35)
finish_score = last_score.render("Your Score", True, black)

def Your_score(score):
    value = score_font.render("Your Score: " + str(score), True, red)
    dis.blit(value, [20, 20])

def our_snake(snake_block, snake_list):
    for x in snake_list:
        #dis.blit(snake_logo,[x[0], x[1], snake_block, snake_block])

        pygame.draw.rect(dis, black, [x[0], x[1], snake_block, snake_block])

def message(msg, color):
    mesg = finish_font.render(msg, True, color)
    dis.blit(mesg, [130, 468])

def gameLoop():
    game_over = False
    game_close = False

    x1 = dis_width / 2
    y1 = dis_height / 2

    x1_change = 0
    y1_change = 0

    snake_List = []
    Length_of_snake = 1

    foodx = round(random.randrange(0, dis_width - snake_block) / 20) * 20
    foody = round(random.randrange(0, dis_height - snake_block) / 20) * 20

    while not game_over:

        while game_close == True:
            dis.blit(game_finish,[-130,0])
            message("Press C-Play Again or Q-Quit", white)
            Your_score(Length_of_snake - 1)
            pygame.display.update()

            for event in pygame.event.get():
                if event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_q:
                        game_over = True
                        game_close = False
                    if event.key == pygame.K_c:
                        gameLoop()
                    if event.type == pygame.QUIT:
                        game_over = True

                    if event.type == pygame.KEYDOWN:
                        if event.key == pygame.K_ESCAPE:
                            pygame.quit()
                            quit()

        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                game_over = True

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_LEFT:
                    x1_change = -snake_block
                    y1_change = 0
                elif event.key == pygame.K_RIGHT:
                    x1_change = snake_block
                    y1_change = 0
                elif event.key == pygame.K_UP:
                    y1_change = -snake_block
                    x1_change = 0
                elif event.key == pygame.K_DOWN:
                    y1_change = snake_block
                    x1_change = 0

        if x1 >= dis_width or x1 < 0 or y1 >= dis_height or y1 < 0:
            pygame.mixer.music.load("out.wav")
            pygame.mixer.music.play()
            game_close = True

        x1 += x1_change
        y1 += y1_change

        dis.blit(back_image,[0,0])
        pygame.draw.rect(dis, white, [foodx, foody, snake_block, snake_block])
        #pygame.draw.circle(dis, white, [foodx, foody], 15,0)
        snake_Head = []
        snake_Head.append(x1)
        snake_Head.append(y1)
        snake_List.append(snake_Head)
        if len(snake_List) > Length_of_snake:
            del snake_List[0]

        for x in snake_List[:-1]:
            if x == snake_Head:
                game_close = True

        our_snake(snake_block, snake_List)
        Your_score(Length_of_snake - 1)

        pygame.display.update()

        if x1 == foodx and y1 == foody:
            pygame.mixer.music.load("beep.wav")
            pygame.mixer.music.play()
            foodx = round(random.randrange(0, dis_width - snake_block) / 20.0) * 20.0
            foody = round(random.randrange(0, dis_height - snake_block) / 20.0) * 20.0
            Length_of_snake += 1

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_ESCAPE:
                    pygame.quit()
                    quit()        

        fpsClock.tick(FPS)

    pygame.quit()
    quit()

gameLoop()

A:

There is an issue with the font use used. Maybe try to replace these:
score_font = pygame.font.SysFont("Algerian", 35)
finish_font = pygame.font.SysFont("copper", 55)

with these:
score_font = pygame.font.SysFont("comicsansms", 35)
finish_font = pygame.font.SysFont("comicsansms", 55)

According to pygame documentation:

[pygame.font.SysFont()] Return a new Font object that is loaded from the system fonts. The font will match the requested bold and italic flags. If a suitable system font is not found this will fall back on loading the default pygame font. The font name can be a comma separated list of font names to look for.

When you set 'Algerian' or 'copper' as fonts and compile the program in an .exe file, pygame fails to find a suitable system font.

