Python Forum
change application image
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
change application image
#3
(Jan-19-2018, 12:05 PM)buran Wrote: please, post your full spec file. the icon in the taskbar is the same as the icon of the exe file. you need to specify the icon attribute in the exe part of the spec file. The line that you show will tell pyinstaller that it need to include this png file when building the exe and this png will be used from your application (e.g. as an tray icon). when it is included with the exe you can use it by reference it with _MEIPASS2. If you don't use _MEIPASS2 you need to supply the png as an external file (i.e. you will distribute exe + png file).

sample as below;
# -*- mode: python -*-

block_cipher = None


a = Analysis(['LT_SC.py'],
             pathex=['C:\\ProgramData\\Miniconda3\\envs\\LT'],
             binaries=[],
             datas=[],
             hiddenimports=['pandas._libs.tslibs.timedeltas'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
a.datas += [('LOAD.png','C:\\ProgramData\\Miniconda3\\envs\\LT\\LOAD.png','Data')]
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          name='LT_SC',
          debug=False,
          strip=False,
          upx=True,
          runtime_tmpdir=None,
          console=False ,
          icon='C:\\ProgramData\\Miniconda3\\envs\\LT\\dist\LOAD.ico' )
Reply


Messages In This Thread
change application image - by issac_n - Jan-19-2018, 10:41 AM
RE: change application image - by buran - Jan-19-2018, 12:05 PM
RE: change application image - by issac_n - Jan-22-2018, 01:07 AM
RE: change application image - by buran - Jan-22-2018, 09:00 AM
RE: change application image - by snippsat - Jan-22-2018, 05:53 PM
RE: change application image - by issac_n - Feb-12-2018, 08:24 AM
RE: change application image - by buran - Feb-12-2018, 10:32 AM
RE: change application image - by issac_n - Feb-22-2018, 03:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to change the resolution of an image and save multiple plots. pianistseb 1 2,403 Dec-11-2018, 07:45 PM
Last Post: micseydel
  Change color pixel in an image louloudevinci 2 39,092 Mar-25-2018, 08:27 PM
Last Post: louloudevinci

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020