def get_price(self, _block_name=None): if _block_name is not None: try: code = self.data[self.data['blockname'] == _block_name].code.unique().tolist() # try to get a datastruct package of lastest price return QA_fetch_get_stock_realtime(code) except: return "Wrong Block Name! Please Check" else: code = self.data.code.unique().tolist() return QA_fetch_get_stock_realtime(code)
def get_price(self, _block_name=None): """get_price Keyword Arguments: _block_name {[type]} -- [description] (default: {None}) Returns: [type] -- [description] """ if _block_name is not None: try: code = self.data[self.data['blockname'] == _block_name].code.unique().tolist() # try to get a datastruct package of lastest price return QA_fetch_get_stock_realtime(code) except: return "Wrong Block Name! Please Check" else: code = self.data.code.unique().tolist() return QA_fetch_get_stock_realtime(code)