Q: Python import restarts other imports I want to create a head tracking interface for a flight simulator. I'm going to use opencv for image acquisition and processing and use vjoy to emulate the joystick (which the flight simulator can pick up & recognise).
As part of developing a toolkit of routines I have a program which highlights the brightest & darkest points in a captured frame which works well.
import numpy as np
import pyvjoy #works if I comment this line out
import cv2

cap = cv2.VideoCapture(0)
#j = pyvjoy.VJoyDevice(1)

while(True):
# Capture frame-by-frame
    ret, frame = cap.read()

# Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
    cv2.imshow('frame - press q to exit',gray)

#    vjoy lines commented out 
#    xAxis=xmin*4000
#    j.data.wAxisX = 0x2000 

#    j.set_axis(HID_USAGE_X, xAxis)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

This code works if I comment out the import of the vjoy library. However, when I import vjoy it forces a reset of the shell even though there are no other active libraries or lines. How can I prevent this?
