-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsample.py
48 lines (43 loc) · 1.09 KB
/
sample.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# import json
# x=json.dumps({"sac": "wefwef", "dydd": "fefewf", "qwdqwd": 0},sort_keys=True)
# print x
# emitobject = json.loads('{"a":"hi"}')
# print json.dumps(emitobject,sort_keys=True)
# from threading import Timer
#
#
# def hello():
# print "hello, world"
#
#
# t = Timer(3.0, hello)
# t.start()
import logging
# create logger
# logger = logging.getLogger('s')
# logger.setLevel(logging.INFO)
#
# # create console handler and set level to debug
# ch = logging.StreamHandler()
# ch.setLevel(logging.DEBUG)
#
# # create formatter
# formatter = logging.Formatter('%(levelname)s - %(message)s')
#
# # add formatter to ch
# ch.setFormatter(formatter)
#
# # add ch to logger
# logger.addHandler(ch)
#
# # 'application' code
# logger.debug('debug message')
# logger.info('info message')
# logger.warn('warn message')
# logger.error('error message')
# logger.critical('critical message')
# import logging
# logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
# logging.warning('And this, too')
# logging.debug('This message should appear on the console')
# logging.info('So should this')