forked from MsLolita/Nodepay_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (28 loc) · 927 Bytes
/
main.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
import asyncio
import sys
from core.utils.logger import logger
def check_tkinter_available():
try:
import customtkinter
return True
except ImportError:
return False
if __name__ == "__main__":
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
try:
if check_tkinter_available():
logger.info("Starting GUI version...")
import customtkinter as ctk
from customtkinter_gui import BotGUI
root = ctk.CTk()
app = BotGUI(root)
app.setup_logger()
root.mainloop()
else:
logger.info("Starting console version...")
from core.menu import ConsoleMenu
menu = ConsoleMenu()
asyncio.run(menu.run())
except KeyboardInterrupt:
logger.info("Application terminated by user")