anviar

Untitled

Feb 27th, 2020
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. import websocket
  4. from argparse import ArgumentParser
  5.  
  6. argparser = ArgumentParser(description='Test WebSocket connection')
  7. argparser.add_argument('--debug', help='clear cache', action="store_true")
  8. argparser.add_argument('-u', '--uri',
  9.                        type=str,
  10.                        required=True)
  11. argparser.add_argument('-t', '--timeout',
  12.                        type=int,
  13.                        default=1)
  14. args = argparser.parse_args()
  15.  
  16. websocket.enableTrace(args.debug)
  17. ws = websocket.create_connection(args.uri, timeout=args.timeout)
Advertisement
Add Comment
Please, Sign In to add comment