473,224 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

py2exe issues with pictures and icons


Hello

I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it uses
for the windows. However, the pictures are stored in the same directory as
the source, something like: C:\Docs and settings\me\My docs\python\program.
When I run the program for the interpreter, just as a .py, everything works
just as it should. However, when I compile the main source as an .exe, and
say let a friend try the program. It fails because it is missing the .ico.
The catch, is I don't want to have it have to installed, at least at this
point, I want it to be able to just run. So how can I make it just run from
any computer with the files not being in the immediate directory. If that is
not possible, how can I put them in the immediate directory and still make
it work. Because that directory may change a lot so the path will change.

Just a few questions. I hope someone out there can help me out!
--
View this message in context: http://www.nabble.com/py2exe-issues-...p18493908.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Jul 16 '08 #1
5 2081
On Jul 16, 1:37*pm, Alexnb <alexnbr...@gmail.comwrote:
Hello

I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it uses
for the windows. However, the pictures are stored in the same directory as
the source, something like: C:\Docs and settings\me\My docs\python\program.
When I run the program for the interpreter, just as a .py, everything works
just as it should. However, when I compile the main source as an .exe, and
say let a friend try the program. It fails because it is missing the .ico..
The catch, is I don't want to have it have to installed, at least at this
point, I want it to be able to just run. So how can I make it just run from
any computer with the files not being in the immediate directory. If thatis
not possible, how can I put them in the immediate directory and still make
it work. Because that directory may change a lot so the path will change.

Just a few questions. I hope someone out there can help me out!
--
View this message in context:http://www.nabble.com/py2exe-issues-...cons-tp1849390...
Sent from the Python - python-list mailing list archive at Nabble.com.

Put the part of the code that needs the ico file(s) into a try/except
block. You could also try reading the py2exe wiki and tutorials. This
one looks like it has relevant data:

http://www.py2exe.org/index.cgi/CustomIcons

Mike
Jul 16 '08 #2

Mike Driscoll wrote:

On Jul 16, 1:37*pm, Alexnb <alexnbr...@gmail.comwrote:
>Hello

I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it uses
for the windows. However, the pictures are stored in the same directory
as
the source, something like: C:\Docs and settings\me\My
docs\python\program.
When I run the program for the interpreter, just as a .py, everything
works
just as it should. However, when I compile the main source as an .exe,
and
say let a friend try the program. It fails because it is missing the
.ico.
The catch, is I don't want to have it have to installed, at least at this
point, I want it to be able to just run. So how can I make it just run
from
any computer with the files not being in the immediate directory. If that
is
not possible, how can I put them in the immediate directory and still
make
it work. Because that directory may change a lot so the path will change..

Just a few questions. I hope someone out there can help me out!
--
View this message in
context:http://www.nabble.com/py2exe-issues-...cons-tp1849390...
Sent from the Python - python-list mailing list archive at Nabble.com.

Put the part of the code that needs the ico file(s) into a try/except
block. You could also try reading the py2exe wiki and tutorials. This
one looks like it has relevant data:

http://www.py2exe.org/index.cgi/CustomIcons

Mike
--
http://mail.python.org/mailman/listinfo/python-list
Well, that may solve the icon problem. But what about getting pictures in
there?

--
View this message in context: http://www.nabble.com/py2exe-issues-...p18495626.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Jul 16 '08 #3

Alexnb wrote:

Mike Driscoll wrote:
>
On Jul 16, 1:37*pm, Alexnb <alexnbr...@gmail.comwrote:
>>Hello

I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it
uses
for the windows. However, the pictures are stored in the same directory
as
the source, something like: C:\Docs and settings\me\My
docs\python\program.
When I run the program for the interpreter, just as a .py, everything
works
just as it should. However, when I compile the main source as an .exe,
and
say let a friend try the program. It fails because it is missing the
.ico.
The catch, is I don't want to have it have to installed, at least at
this
point, I want it to be able to just run. So how can I make it just run
from
any computer with the files not being in the immediate directory. If
that is
not possible, how can I put them in the immediate directory and still
make
it work. Because that directory may change a lot so the path will
change.

Just a few questions. I hope someone out there can help me out!
--
View this message in
context:http://www.nabble.com/py2exe-issues-...cons-tp1849390...
Sent from the Python - python-list mailing list archive at Nabble.com.


Put the part of the code that needs the ico file(s) into a try/except
block. You could also try reading the py2exe wiki and tutorials. This
one looks like it has relevant data:

http://www.py2exe.org/index.cgi/CustomIcons

Mike
--
http://mail.python.org/mailman/listinfo/python-list

Well, that may solve the icon problem. But what about getting pictures in
there?
Okay, the icon fix didn't really fix it, what it did was make the .exe have
the icon as the little picture for the shortcut, but it isn't really a
shortcut. Whatever. But, I went and ran it on another computer and this was
the error log it created right off the bat.

Traceback (most recent call last):
File "The GUI.py", line 696, in <module>
File "Tkinter.pyc", line 1515, in wm_iconbitmap
_tkinter.TclError: bitmap "C:\Documents and Settings\Alex\My
Documents\PYTHON\DictionaryApp\Windows.ico" not defined

--
View this message in context: http://www.nabble.com/py2exe-issues-...p18495836.html
Sent from the Python - python-list mailing list archive at Nabble.com.

Jul 16 '08 #4
On Jul 16, 3:22*pm, Alexnb <alexnbr...@gmail.comwrote:
Alexnb wrote:
Mike Driscoll wrote:
On Jul 16, 1:37*pm, Alexnb <alexnbr...@gmail.comwrote:
Hello
>I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it
uses
for the windows. However, the pictures are stored in the same directory
as
the source, something like: C:\Docs and settings\me\My
docs\python\program.
When I run the program for the interpreter, just as a .py, everything
works
just as it should. However, when I compile the main source as an .exe,
and
say let a friend try the program. It fails because it is missing the
.ico.
The catch, is I don't want to have it have to installed, at least at
this
point, I want it to be able to just run. So how can I make it just run
from
any computer with the files not being in the immediate directory. If
that is
not possible, how can I put them in the immediate directory and still
make
it work. Because that directory may change a lot so the path will
change.
>Just a few questions. I hope someone out there can help me out!
--
View this message in
context:http://www.nabble.com/py2exe-issues-...cons-tp1849390...
Sent from the Python - python-list mailing list archive at Nabble.com..
Put the part of the code that needs the ico file(s) into a try/except
block. You could also try reading the py2exe wiki and tutorials. This
one looks like it has relevant data:
>http://www.py2exe.org/index.cgi/CustomIcons
Mike
--
http://mail.python.org/mailman/listinfo/python-list
Well, that may solve the icon problem. But what about getting pictures in
there?

Okay, the icon fix didn't really fix it, what it did was make the .exe have
the icon as the little picture for the shortcut, but it isn't really a
shortcut. Whatever. But, I went and ran it on another computer and this was
the error log it created right off the bat.

Traceback (most recent call last):
* File "The GUI.py", line 696, in <module>
* File "Tkinter.pyc", line 1515, in wm_iconbitmap
_tkinter.TclError: bitmap "C:\Documents and Settings\Alex\My
Documents\PYTHON\DictionaryApp\Windows.ico" not defined

--
View this message in context:http://www.nabble.com/py2exe-issues-...cons-tp1849390...
Sent from the Python - python-list mailing list archive at Nabble.com.
Crumb! I actually use a GUI wrapper for py2exe called GUI2Exe which
makes this sort of thing much easier. Unfortunately, it also makes me
less knowledgeable. You can check it out here:

http://xoomer.alice.it/infinity77/main/GUI2Exe.html

Also, there's a distutils group and a py2exe group. Both of them would
know a lot more about how to do this.

https://lists.sourceforge.net/lists/...o/py2exe-users
http://www.python.org/community/sigs...tils-sig/list/

Mike
Jul 16 '08 #5
Alexnb wrote:
Hello

I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it uses
for the windows. However, the pictures are stored in the same directory as
the source, something like: C:\Docs and settings\me\My docs\python\program.
When I run the program for the interpreter, just as a .py, everything works
just as it should. However, when I compile the main source as an .exe, and
say let a friend try the program. It fails because it is missing the .ico.
The catch, is I don't want to have it have to installed, at least at this
point, I want it to be able to just run. So how can I make it just run from
any computer with the files not being in the immediate directory. If that is
not possible, how can I put them in the immediate directory and still make
it work. Because that directory may change a lot so the path will change.

Just a few questions. I hope someone out there can help me out!
Windows can't read minds. The icon's/pictures have to either be in the same
directory as the .exe or the .exe has to have a way to find them in another
folder (e.g. via .ini config file).

Takw a few minutes and go to: http://jrsoftware.org/isinfo.php

It is a free Windows installer that I use to take py2exe, icons, pictures,
..ini files, documentation, etc and wrap it all up into a nice, neat package that
can be distributed as a single .exe. It will take a couple of hours, but it
will be hours well spent (especially if you think you will do this more than once).

Larry
Jul 17 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kathleen Kudzma | last post by:
I'm having a problem with py2exe for Python 2.3. I got fixed the Lookuperror no codec search functions registered: can't find encoding by following the instructions on the py2exe page (added...
2
by: John Carter | last post by:
Does anyone know how to embed PIL into a py2exe program. As far as I can tell PIL is not finding its plugins for Image I/O, they are imported dynamically as required. So I cant load or save...
11
by: Grant Edwards | last post by:
I'm trying in vain to set the icon for the executable generated by py2exe. According to various sources there are two answers: 1) Do it on the command line: python setup.py py2exe --icon...
1
by: Dave Guenthner | last post by:
I wrote my first Python script today and was very impressed at how concise the code was and development time. In addition, I am using the latest stable version of Python from ActiveState.com. ...
2
by: kdahlhaus | last post by:
Is anyone aware of issues with Py2exe and extensions compiled with cygwin/mingw for Python 2.3? I have an extension that wraps access to some C DLLs. The generated executable always segfaults at...
21
by: MLH | last post by:
If I choose a command button on a form in design view, open the properties box and click the Picture property and its wiz button, I'm presented with a lengthy list of pictures. Everything from Add...
0
by: Durumdara | last post by:
Hi ! I have an application that I compile to exe. 1.) I want to compile main.ico into exe, or int zip. Can I do it ? 2.) Can I compile the result to my specified directory, not into the...
9
by: mimenko | last post by:
Hello, I'd want to show and hide the same icons (pictures) on a web page that contains several icons. Some are identical, some are different (for ex : 3 items "A", 4 items "B", 2 items "C"). Is...
2
by: flarefight | last post by:
I have created an app using python and then converting it to an exe using py2exe, and have the following code: "icon_resources": in my py2exe setup file, the appFavicon works fine and it sets...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.