[Tutor] compiled images

2005-11-17 Thread Fred Lionetti
Hi everyone,

Thanks everyone for the help with lambda expressions!  Your
suggestions and discussions were great!

I've got another question I think you may have come across before. 
I'm planning on purchasing a license to use some stock icons in an
application I'm developing.  The problem is the license requires this:

Where an application is to be distributed, the graphical media must
be compiled into the application binary file or its associated data
files, documentation files, or components.

Anyone have any idea as to how I could basically compile all my
artwork into a data file for a python application?  Would this require
compiling them into a *.dll/*.so?  It seems like there must be any
easier way--Also, I need my application to work on windows + linux
(and mac).

Any suggestions/experience would be greatly appreciated!

Thanks,
Fred
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] compiled images

2005-11-17 Thread Liam Clarke-Hutchinson
Hehe, 

Sounds like someone's license was designed for C/C++.




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Fred Lionetti
Sent: Friday, 18 November 2005 8:29 a.m.
To: tutor@python.org
Subject: [Tutor] compiled images


Hi everyone,

Thanks everyone for the help with lambda expressions!  Your suggestions and
discussions were great!

I've got another question I think you may have come across before. 
I'm planning on purchasing a license to use some stock icons in an
application I'm developing.  The problem is the license requires this:

Where an application is to be distributed, the graphical media must be
compiled into the application binary file or its associated data files,
documentation files, or components.

Anyone have any idea as to how I could basically compile all my artwork
into a data file for a python application?  Would this require compiling
them into a *.dll/*.so?  It seems like there must be any easier way--Also, I
need my application to work on windows + linux (and mac).

Any suggestions/experience would be greatly appreciated!

Thanks,
Fred
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

A new monthly electronic newsletter covering all aspects of MED's work is now 
available.  Subscribers can choose to receive news from any or all of seven 
categories, free of charge: Growth and Innovation, Strategic Directions, Energy 
and Resources, Business News, ICT, Consumer Issues and Tourism.  See 
http://news.business.govt.nz for more details.




http://www.govt.nz - connecting you to New Zealand central  local government 
services

Any opinions expressed in this message are not necessarily those of the 
Ministry of Economic Development. This message and any files transmitted with 
it are confidential and solely for the use of the intended recipient. If you 
are not the intended recipient or the person responsible for delivery to the 
intended recipient, be advised that you have received this message in error and 
that any use is strictly prohibited. Please contact the sender and delete the 
message and any attachment from your computer.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] compiled images

2005-11-17 Thread John Fouhy
On 18/11/05, Fred Lionetti [EMAIL PROTECTED] wrote:
 Anyone have any idea as to how I could basically compile all my
 artwork into a data file for a python application?  Would this require
 compiling them into a *.dll/*.so?  It seems like there must be any
 easier way--Also, I need my application to work on windows + linux
 (and mac).

Maybe you could use shelve?

For instance, if you have myIcon1.gif, myIcon2.gif, myIcon3.gif:


import shelve
shelf = shelve.open('iconData')
for fn in ['myIcon1.gif', 'myIcon2.gif', 'myIcon3.gif']:
shelf[fn] = file(fn, 'rb').read()


Then, in future, you should be able to access your icons by just:

 shelf = shelve.open('iconData')
 doSomething(shelf['myIcon2.gif'])

(and if your methods require a file-like object instead of just a
binary string, you can use the StringIO module)

There may be space or time issues --- you might want to experiment :-)
--- but it will definitely be cross-platform.

--
John.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor