Najeebsk

PyInstaller-ICON.txt

Jun 3rd, 2026
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #================ADD-IMAGE-ICON=================
  2. import os
  3. import sys
  4. def resource_path(relative_path):
  5.     """ Get the absolute path to the resource, works for PyInstaller. """
  6.     if getattr(sys, '_MEIPASS', False):
  7.         return os.path.join(sys._MEIPASS, relative_path)
  8.     return os.path.join(os.path.abspath("."), relative_path)
  9.  
  10. # Use this function to load files:
  11. #splash_image = resource_path("THEME/splash-7.png")
  12. icon_path = resource_path("CONVER.ico")
  13. #================ADD-IMAGE-ICON=================
  14. self.root.iconbitmap(icon_path)
  15.  
  16. pyinstaller --onefile --windowed --name=ENGLISH-URDU-CONVERSATION --icon=CONVER.ico --add-data "CONVER.ico;." ENGLISH-URDU-CONVERSATION.py
  17. pyinstaller --onefile --windowed --name=ENGLISH-URDU-DICTIONARY --icon=DIC.ico --add-data "DIC.ico;." ENGLISH-URDU-DICTIONARY.py
Advertisement
Add Comment
Please, Sign In to add comment