#๐Ÿ”’ can anyone help me change the icon to my exe

44 messages ยท Page 1 of 1 (latest)

wispy brook
#

pls

bold lilyBOT
#

@wispy brook

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

wispy brook
open epoch
#

Isn't that just a generic Python file? The file icon is controlled by the program that will execute it.

#

(You can change it locally; but nobody will see the changes you make.)

wispy brook
#

i want them to see the icon tho

#

i want this

open epoch
#

Right-- that's just a .py file right?

wispy brook
#

ye

waxen kettle
#

Ive done it before but I cant remember how

open epoch
#

You cannot do this for other people.

wispy brook
#

wha abt resource hacker

#

that or no

open epoch
#

No.

#

You cannot change this for other people.

wispy brook
#

oh

#

how i change it formyself then

open epoch
#

It's a bit convoluted and requires registry modification.

In HKCR there is a list of filetypes, e.g., .py.
This points to a PROGID as the (DEFAULT) value.
That PROGID can be referenced in HKEY_CLASSES_ROOT\{PROGID}\DefaultIcon
The value of DefaultIcon's (Default) key is a path to the icon file. You can modify this to the path of your file and restart Explorer.

wispy brook
#

that looks like alot of work im ngl

open epoch
#

Yup.

#

There's other ways to do it, but not for .py files.

wispy brook
#

py -m PyInstaller --onefile --noconsole --icon=youricon.ico kb.py

#

chatgpt said this

open epoch
#

If you want to package it as an executable instead, sure.

#

You have a .py file.

#

It may or may not be compatible as a PyInstaller executable however.

wispy brook
#

hm

#

i try'

open epoch
#

What's your program do? I might be able to tell you if it'll work.

wispy brook
#

like pycharm?

open epoch
#

Nah, what does kb.py do?

wispy brook
#

it a gui

#

like tg macro kinda

open epoch
#

GUI's tend to have some issues with PyInstaller.

#

It has to do with asset bundling, which transparently, I don't know enough about to assist you with.

wispy brook
#

ohh

#

I js give up

#

no one gnna see it so its fine

open epoch
#

Could always just open source it. If it's useful, people can download and run it that way. If you include good instructions, people tend to figure it out.

wispy brook
#

okay ill think abt it

#

ty

#

!close

bold lilyBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.