473,513 Members | 2,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

icon resource in setup script

Hi,

I have encountered an error whenever I put the "icon_resources" line in my setup.py file:

from distutils.core import setup

import py2exe
setup(
windows=[
{'script':"test.py"},
{'icon_resources': [(1, 'smiles.ico')]},
],
)

The error I get:

running py2exe
error: This target class requires an attribute 'script'

How can I make the icon thing work in my script? I tried using --icon but it said --icon is not recognized.

Regards,

- Wong

Jul 18 '05 #1
2 3514
"Joe Wong" <jo*****@mango.cc> writes:
Hi,

I have encountered an error whenever I put the "icon_resources" line in my setup.py file:

from distutils.core import setup

import py2exe
setup(
windows=[
{'script':"test.py"},
{'icon_resources': [(1, 'smiles.ico')]},
],
)

The error I get:

running py2exe
error: This target class requires an attribute 'script'

How can I make the icon thing work in my script? I tried using --icon
but it said --icon is not recognized.


For each target, you must supply *one* dictionary:

setup(
windows=[
{'script':"test.py",
'icon_resources': [(1, 'smiles.ico')]},
],
)
Thomas
Jul 18 '05 #2
"Joe Wong" <jo*****@mango.cc> wrote:
setup(
windows=[
{'script':"test.py"},
{'icon resources': [(1, 'smiles.ico')]},
],
)


You've got too many braces:

setup(
windows = [
{
"script": "test.py",
"icon_resources": [(1, "smiles.ico")]
}
],
)
Jul 18 '05 #3

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

Similar topics

0
1373
by: Haim Ashkenazi | last post by:
Hi I'm trying to build a binary with py2exe. I've used the method suggested in the py2exe wiki about adding icon resources to apps. it build ok on win2k, but when I try to build the same on win98 I get this error: copying C:\Python23\Lib\site-packages\py2exe\run.exe -> C:\My Documents\NS_Backup\dist\NS_Backup.exe Traceback (most recent...
11
15728
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 foo.ico That generates a usage error: error: --icon not recognized
4
3713
by: Terry | last post by:
There are a number of things about using unmanaged resources in Windows Forms programming that is unclear to me. In C++, if you loaded an icon resource using "ExtractIcon()", the resource was valid until you called "DestroyIcon()". If you didn't, you had a leak. In C#, I need to load icons from unmanaged programs (.exe, dll) at run time...
2
7326
by: Jack | last post by:
I was learning Windows programming in C# using Charles Petzold book, but this book was written for the older version of .NET. The example of using icon from embedded resource fails to work when executed step by step following the book directions and I can't find what is wrong. The executable throws an exception claiming that the resource...
3
8143
by: Wayne | last post by:
I currently have an app whose Icon I am setting. I want to set the icons in my forms at run time to that of the application icon. How do I retrieve the application Icon so that I can use it for my forms? once retrieved can I just set the form Icon? or do I need to do something special? Thanks Wayne
0
1342
by: carl.manaster | last post by:
Hi, In <http://groups-beta.google.com/group/microsoft.public.dotnet.languages.csharp/msg/05abaf8460c61859>, back in 2003, "SleazySt" wrote that > Unfortunately, C# projects can't have resource scripts. > Resources added to .NET applications by adding them to > the project and designating them an "Embedded Resource" > are included in a...
4
6532
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks completely different. I overwrote the old ico file with the new ico file and re-ran the program. I still see the old logo at run-time. I...
0
1135
by: Vyz | last post by:
I have given icon like this to main frame of my program ib=wx.IconBundle() ib.AddIconFromFile("SriPadma.ico",wx.BITMAP_TYPE_ANY) self.SetIcons(ib and then I have made binary with py2exe and in setup file mentioned it as icon resource. windows = }
0
1917
by: vishnu1986 | last post by:
Hi guys, I saw quite a few posts regarding this but I was unable to solve this problem that I am facing. First off, when I do the following in my setup.py, windows= } ], Python crashes and I am unable to run the script using python setup.py py2exe.
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.