import sys, traceback, u6 d = u6.U6() d.getName() d.close() d = u6.U6() print 'That worked' print 'This wont (and i need to unplug/replug the device):' d = u6.U6() d.close() d = u6.U6()