def __init__(self,tws, subscriptions):
        ''' init class, register handlers '''
      
        tws.register(self._priceHandler,message.TickPrice)
        tws.register(self._sizeHandler,message.TickSize)
        
        self.subscriptions = subscriptions        
        
        # save starting time of logging. All times will be in seconds relative
        # to this moment
        self._startTime = time.time() 
        
        # create data directory if it does not exist
        if not os.path.exists('tickLogs'): os.mkdir('tickLogs')     
        
        # open data file for writing
        fileName = dt.datetime.now().strftime('%H_%M_%S') % 'tickLogs\\tickLog_%s.csv'
        print 'Logging ticks to ' , fileName
        self.dataFile = open(fileName,'w')
dataset/ETHPy150Open cmorgan/trading-with-python/cookbook/ib_logQuotes.py/TickLogger.__init__/swapped operands of `%`