Skip to content

Instantly share code, notes, and snippets.

View geethanjalieswaran's full-sized avatar

GeethanjaliEswaran geethanjalieswaran

View GitHub Profile
#use defaults
test_class = TestClass()
test_class.test_method()
#declare retry_count and retry_interval
test_class = TestClass(retry_count=2, retry_interval=5)
test_class.test_method()
@retry()
def test1():
#
@retry(retry_count=5, retry_interval=3)
def test2:
#
@geethanjalieswaran
geethanjalieswaran / decorator_inner_class.py
Last active November 19, 2019 17:12
Python Decorators
import time
import functools
class Test(object):
"""
class Test
"""
import time
# retry decorator
# Example:
# @retry(3, 2) or @retry()
# def test():
# pass
def retry(retry_count=3, retry_interval=2):
"""
@geethanjalieswaran
geethanjalieswaran / websocket_client.html
Created February 27, 2017 12:57
Sample websocket client
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>