(Jul-24-2023, 02:10 PM)deanhystad Wrote: @snippsat is correct. You do not get the error when importing the library. It only has an effect when the program exits, which happens immediately if your program consists solely of "import vpython". Try this:
import vpython import time time.sleep(10)No error until 10 seconds has passed.
My guess is the divide by zero function is a default exit function that you are meant to override.
I tried it and it doesn't work. The error is ZeroDivisionError as before.
Error:D:\pythonProject\OpenCVLearning\venv\Scripts\python.exe D:\pythonProject\vpython\main.py
Exception ignored in atexit callback: <function Exit at 0x0000027DBAADB420>
Traceback (most recent call last):
File "D:\pythonProject\OpenCVLearning\venv\Lib\site-packages\vpython\vpython.py", line 22, in Exit
a = 1.0/zero
~~~^~~~~
ZeroDivisionError: float division by zero
exit
Process finished with exit code 0
This is screenshot of the error.