From ac2c0d1bf41746b4c1ee95b39c430e4d80c03ec8 Mon Sep 17 00:00:00 2001 From: hnu202111020428 Date: Wed, 29 Dec 2021 19:56:50 +0800 Subject: [PATCH] update software icon --- musicplayer.py | 13 +++++++++++-- resources/music.png | Bin 0 -> 11836 bytes 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 resources/music.png diff --git a/musicplayer.py b/musicplayer.py index ee3c96f..e6ed450 100644 --- a/musicplayer.py +++ b/musicplayer.py @@ -6,6 +6,8 @@ import time from threading import Thread import math from mutagen import File +import sys +import win32api #from wx.media import MediaCtrl APP_TITLE = u'音乐播放器' @@ -13,7 +15,6 @@ MAX_LYRIC_ROW = 18 LYRIC_ROW_REG = '\[[0-9]{2}:[0-9]{2}.[0-9]{2,}\]' MAX_MUSIC_NAME_LEN = 70 # 歌名展示的时候最长字符限制 - class MainFrame(wx.Frame): '''程序主窗口类,继承自wx.Frame''' @@ -70,7 +71,15 @@ class MainFrame(wx.Frame): pygame.mixer.init() self.music = pygame.mixer.music self.SONG_FINISHED = pygame.USEREVENT + 1 - + + if hasattr(sys, "frozen") and getattr(sys, "frozen") == "windows_exe": + exeName = win32api.GetModuleFileName(win32api.GetModuleHandle(None)) + icon = wx.Icon(exeName, wx.BITMAP_TYPE_ANY) + else : + icon = wx.Icon('resources/music.png', wx.BITMAP_TYPE_ANY) + self.SetIcon(icon) # 以下可以添加各类控件 + pass + ''' # 下载音乐面板 self.down_music_panel = None diff --git a/resources/music.png b/resources/music.png new file mode 100644 index 0000000000000000000000000000000000000000..1c5740589e3c3f5110b58790b489960ae0c6160e GIT binary patch literal 11836 zcmeHthgZ{0(d>%nPB6MoUvD9@kIA3Qbp7!vrz>v)$;1gsi5({?~KWn`R_-L ziSx2jQDvyC>iH^aDgJLKwi_~rs5$L!B7O7 zlhaGw03Y0P^J)>C4FusJ6Boaa!+-~}yaB)HY=L$W9gDnJ3ZfQk<+Y17N+Fqdtlas+=VP)lnSJXox zcm6{z{C|#g(LOQo0#&7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