is there any way to have icon for .exe file that created as an entry point using pypi?

Question:

I made python package for a gui application(pyqt5 base) there is a problem when I search for it using windows search the app doesn’t have any icon is there any way to fix it ? I’m looking for a way through setup.py (config file for making python package)

enter image description here

setup.py


from distutils.core import setup
from setuptools import setup

setup(
    name="subtodl", 
    packages = ['Scripts'], 
    version="0.0.1",
    license='MIT',     
    description = 'a handy tools to download subtitle ',   
    author = 'mehdi',                  
    install_requires=[
    "pyqt5; platform_system=='Windows'", 
    "beautifulsoup4", 
    "lxml",
    "PyQt5==5.11.3 ;platform_system=='Linux'",
    "requests",
    "wget",
    ],
    classifiers=[
        "Programming Language :: Python :: 3.6",
    ],
    entry_points={

        'gui_scripts': [
        'subtodl= Scripts.subtodlmain:main',
    ],
    },
)
Asked By: mehdi

||

Answers:

The easiest way to do what you want is:

  1. Create a shortcut to the app (drag it somewhere while holding ctrl and shift).
  2. Right click the shortcut and click properties.
  3. Click change icon, and select the icon file you want.

Now to open your app you just need to double click your shortcut that can be placed anywhere.

Answered By: Dpythonrobot

well i finally found the answer but it seems that is an old way to do so and i don’t know how to make it cross platform also don’t know how to not hard code path
but it does work i just test it on a Linux base machine

    data_files=[
    ('/share/applications', [subtodl.desktop"])
]
Answered By: mehdi
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.