22 lines
682 B
Python
22 lines
682 B
Python
while True:
|
|
try:
|
|
import numpy, cv2
|
|
|
|
# Display random image in fullscreen window
|
|
cv2.namedWindow("crash", cv2.WND_PROP_FULLSCREEN)
|
|
cv2.setWindowProperty("crash", cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
|
|
cv2.imshow("crash", numpy.random.randint(0, 256, (1600, 2000, 3), dtype=numpy.uint8))
|
|
|
|
# Wait for 'P' key press
|
|
key = cv2.waitKey(0)
|
|
while key not in [ord('P'), ord('p')]:
|
|
key = cv2.waitKey(0)
|
|
|
|
cv2.destroyAllWindows()
|
|
except Exception as e:
|
|
import os
|
|
os.system("py -m pip install numpy opencv-python")
|
|
print("Error occurred:", e)
|
|
continue
|
|
break
|