File tree 2 files changed +16
-7
lines changed
2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 14
14
import serial
15
15
import glob
16
16
import sys
17
+ import os
17
18
18
19
19
20
logging .basicConfig (level = logging .INFO )
20
- customtkinter .set_appearance_mode (" System" )
21
+ customtkinter .set_appearance_mode (' System' )
21
22
style .use ('ggplot' )
22
23
23
24
config = ConfigParser ()
@@ -292,14 +293,23 @@ def serial_ports():
292
293
return result
293
294
294
295
296
+ def get_icon ():
297
+ current_path = os .getcwd ()
298
+ if sys .platform == 'linux' :
299
+ path_n_file = current_path + "/assets/icon.png"
300
+ elif os .name == 'win' :
301
+ path_n_file = current_path + "\\ assets\\ icon.png"
302
+ else :
303
+ raise Exception ("Unknown system" )
304
+ print (path_n_file )
305
+ return path_n_file
306
+
307
+
295
308
def main ():
296
309
loop = asyncio .new_event_loop ()
297
310
asyncio .set_event_loop (loop )
298
-
299
- customtkinter .set_appearance_mode ("System" )
300
- customtkinter .set_default_color_theme ("blue" )
301
-
302
- Window (loop )
311
+ app = Window (loop )
312
+ app .wm_iconphoto (True , tk .PhotoImage (file = get_icon ()))
303
313
loop .run_forever ()
304
314
loop .close ()
305
315
@@ -310,4 +320,3 @@ def main():
310
320
311
321
312
322
313
-
You can’t perform that action at this time.
0 commit comments