SHARE
TWEET

Untitled

a guest Sep 12th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def read_conn_file(path: str) -> None:
  2.     try:
  3.         with open(path) as f:
  4.             for line in f:
  5.                 if line[0] == '#':
  6.                     # Ignore comments.
  7.                     continue
  8.                 conn_line: str = line.rstrip()
  9.                 conn_line_splited: list = conn_line.split('\t')
  10.  
  11.                 timestamp = float(conn_line_splited[0])
  12.                 conn_uid = conn_line_splited[1]
  13.                 src_ip = conn_line_splited[2]
  14.                 # ETC.
  15.     except FileNotFoundError:
  16.         print('Error: ')
  17.  
  18.  
  19. path = 'PATH_TO_CONN_FILE'
  20. read_conn_file(path)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top