def get_tick_data(code=None, date=None, retry_count=3, pause=0.001):
 if ((code is None) or (len(code) != 6) or (date is None)):
  return None
 symbol = _code_to_symbol(code)
 for _ in range(retry_count):
  time.sleep(pause)
  try:
   re = Request((ct.TICK_PRICE_URL % (ct.P_TYPE['http'], ct.DOMAINS['sf'], ct.PAGES['dl'], date, symbol)))
   lines = urlopen(re, timeout=10).read()
   lines = lines.decode('GBK')
   if (len(lines) < 20):
    return None
   df = pd.read_table(StringIO(lines), names=ct.TICK_COLUMNS, skiprows=[0])
  except Exception as e:
   print e
  else:
   return df
 raise IOError(ct.NETWORK_URL_ERROR_MSG)

def get_tick_data ( code = None , date = None , retry_count = 3 , pause = 0.001 ) : if ( ( code is None ) or ( len ( code ) != 6 ) or ( date is None ) ) : return None symbol = _code_to_symbol ( code ) for _ in range ( retry_count ) : time . sleep ( pause ) try : re = Request ( ( ct . TICK_PRICE_URL % ( ct . P_TYPE [ 'http' ] , ct . DOMAINS [ 'sf' ] , ct . PAGES [ 'dl' ] , date , symbol ) ) ) lines = urlopen ( re , timeout = 10 ) . read ( ) lines = lines . decode ( 'GBK' ) if ( len ( lines ) < 20 ) : return None df = pd . read_table ( StringIO ( lines ) , names = ct . TICK_COLUMNS , skiprows = [ 0 ] ) except Exception as e : print e else : return df raise IOError ( ct . NETWORK_URL_ERROR_MSG )
parameters code:string 股票代码 e .