1

Can i compile files like:
- Images,
- sounds,
- fonts,
- etc..

For example if I have "click.wav" and i dont want to let users play it themself.

Nat Dempkowski
  • 2,331
  • 1
  • 19
  • 36
Trsak
  • 303
  • 1
  • 4
  • 8
  • possible duplicate of http://stackoverflow.com/questions/6689410/how-to-compile-all-resources-into-one-executable-file – yuvi May 17 '14 at 20:46
  • Nope, I am using cx freezer. – Trsak May 17 '14 at 20:50
  • 1. Yes, I didn't notice the tag straight away (you should've mentioned in the question too). Then maybe you need to switch over, because I'm not sure cx_freeze provides you with that option (and PyInstaller does, as noted in the other question). 2. quickly going over the cx_freeze docs, the only maybe-viable solution is to use the [data files functionality](http://cx-freeze.readthedocs.org/en/latest/faq.html#using-data-files), have you tried that? It's not very clear what types you can use it for, but I'd give it a try – yuvi May 17 '14 at 20:55
  • I would really like to use PyInstaller, but sadly I didn't found version for Python 3.4 – Trsak May 17 '14 at 21:02
  • 1
    So Guys from reddit told me some really good idea: "Hmm, you could try zipping the files and using the zipfile module to read it. Then just rename the zipfile from .zip to .whatever. Not exactly uncrackable security, but may get the job done.". Going to do this probably – Trsak May 17 '14 at 21:06
  • Yeah, there's no PyInstaller for 3.4, sad to say. The solution you mention is definitly a viable option, and if security is bothering you, you can also encrypt the zipped file with [PyCrypto](https://www.dlitz.net/software/pycrypto/) – yuvi May 17 '14 at 21:08

1 Answers1

0

From what I've done, no, you cannot. The best ways imo are as follows:

Making folders (files>images) to make it less desirable to look for them.

(Not sure how well this would work with pygame) but hidden folders might work. I used hidden folders for file writing in python.

Otherwise I think that it wouldn't be so bad if someone were to just play a sound file or look at your artwork, is there a specific problem with it?

HKVariant
  • 837
  • 10
  • 23