Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • compiled images

    1 answers - 994 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    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, I need my application to work on windows + linux
    (and mac).
    Any suggestions/experience would be greatly appreciated!
    Thanks,
    Fred
    Tutor maillist - Tutor (AT) python (DOT) org
  • No.1 | | 1079 bytes | |

    18/11/05, Fred Lionetti <lordvader (AT) gmail (DOT) comwrote:
    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, 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 StringI module)

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

Re: compiled images


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 1 =
QUESTION ON "Python"

EMSDN.COM