#๐ how am i able to add an .ico file to vsc
45 messages ยท Page 1 of 1 (latest)
@ocean flame
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.
what is adding a file in this context
yes
So just putting a file in a folder?...
VS Code is a text editor, so I am still having trouble understanding
look
so
im trying to compile everything into an exe file right
then i would put the image
but the
i changed the directory
to where my py file was right?
What language are you using? What code are you using to compile the exe?
and it keeps telling me it dosent exist
python i use
cd
Are you using pyinstaller?
yep
Ok so you want to embed the icon into the bundle
yup
How are you doing it right now? What's your pyinstaller command?
And how are you referencing the icon path in your python code?
see the thing is
since i cant change the directory
i cant compile it all into an exe
am i supposed to put it into the python folder enviorment?
or can i keep it anywhere i want
I need to know those two things, and also the project structure
ok gimme a sec
From what I can see you give the icon path in the options when you run pyinstaller
ok thank you js gimme a sec
Also use absolute path to reference icon in the command
Well you can also use a relative path, but it depends on you project structure, you should call the pyinstaller command when inside the root folder of your project, and your icons are in the same folder or in some nested folder.
Idk if pyinstaller can accepts relative paths tho
it can, but i don't know it it will access the file if it's not somewhere under the project directory or if it will traverse paths outside the project tree
the icon for the exe is pretty basic and works well if you have an .ico file with all the required sizes in it
but windows can cache the icon for a file that you have browsed/listed in Windows Explorer, sometimes you have to rename the file or move it somewhere else (or even switch view so that it shows the icon in another size) for the new/correct icon to appear on your system
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.