-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (23 loc) · 1.22 KB
/
main.py
File metadata and controls
37 lines (23 loc) · 1.22 KB
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
import logging
from myconfig import *
from connectors.binance import BinanceClient
from interface.root_component import Root
# Create and configure the logger object
logger = logging.getLogger()
logger.setLevel(logging.DEBUG) # Overall minimum logging level
stream_handler = logging.StreamHandler() # Configure the logging messages displayed in the Terminal
formatter = logging.Formatter('%(asctime)s %(levelname)s :: %(message)s')
stream_handler.setFormatter(formatter)
stream_handler.setLevel(logging.INFO) # Minimum logging level for the StreamHandler
#file_handler = logging.FileHandler('info.log') # Configure the logging messages written to a file
#file_handler.setFormatter(formatter)
#file_handler.setLevel(logging.DEBUG) # Minimum logging level for the FileHandler
logger.addHandler(stream_handler)
#logger.addHandler(file_handler)
if __name__ == '__main__': # Execute the following code only when executing main.py (not when importing it)
# binance = BinanceClient(pKeyTN, sKeyTN,
# testnet=True, futures=True)
binance = BinanceClient(pKey, sKey,
testnet=False, futures=True)
root = Root(binance)
root.mainloop()