I've seen a number of similar questions out there, but none of the solutions have worked for me. This is incredibly simple, so perhaps I'm overlooking something trivial.
My code (create a display window in pygame):
import pygame
pygame.init()
win = pygame.display.set_mode((500, 500))
When I run this file from the terminal (python file_name.py) the entire screen freezes and I have to reboot (power off my virtual machine). However, if I write these lines of code in python within the terminal directly, the window pops open as it should. What's the deal with that?
What I've tried: Putting the last line a while loop, putting this into a main function, and using time.sleep() to delay before the program ends.
python 3.7.4, pygame 2.0.0, Debian 10.3.0 (running within virtualBox 6.1)