def sz_margin_details(date='', retry_count=3, pause=0.001):
 for _ in range(retry_count):
  time.sleep(pause)
  try:
   request = Request((rv.MAR_SZ_MX_URL % (ct.P_TYPE['http'], ct.DOMAINS['szse'], ct.PAGES['szsefc'], date)))
   lines = urlopen(request, timeout=10).read()
   if (len(lines) <= 200):
    return pd.DataFrame()
   df = pd.read_html(lines, skiprows=[0])[0]
   df.columns = rv.MAR_SZ_MX_COLS
   df['stockCode'] = df['stockCode'].map((lambda x: str(x).zfill(6)))
   df['opDate'] = date
  except Exception as e:
   print e
  else:
   return df
 raise IOError(ct.NETWORK_URL_ERROR_MSG)

def sz_margin_details ( date = '' , retry_count = 3 , pause = 0.001 ) : for _ in range ( retry_count ) : time . sleep ( pause ) try : request = Request ( ( rv . MAR_SZ_MX_URL % ( ct . P_TYPE [ 'http' ] , ct . DOMAINS [ 'szse' ] , ct . PAGES [ 'szsefc' ] , date ) ) ) lines = urlopen ( request , timeout = 10 ) . read ( ) if ( len ( lines ) <= 200 ) : return pd . DataFrame ( ) df = pd . read_html ( lines , skiprows = [ 0 ] ) [ 0 ] df . columns = rv . MAR_SZ_MX_COLS df [ 'stockCode' ] = df [ 'stockCode' ] . map ( ( lambda x : str ( x ) . zfill ( 6 ) ) ) df [ 'opDate' ] = date except Exception as e : print e else : return df raise IOError ( ct . NETWORK_URL_ERROR_MSG )
parameters date:string 明细数据日期 format：yyyy-mm-dd 默认为空 retry_count : int .